Linux Eliminates the Strncpy API After Six Years of Work, 360 Patches

After six years of cleanup, Linux finally dumps a bug-prone old copy tool — and the comments got spicy

TLDR: Linux 7.2 finally removed a long-troublesome text-copy feature after six years of cleanup, aiming to cut bugs and confusion in one of the world’s most important software projects. Commenters turned it into a full drama thread about ancient design mistakes, open-source grudges, and whether text handling in computers was broken from the start.

After six years, 360+ code changes, and what feels like an entire era of programmer grumbling, Linux has finally kicked out an old text-copying tool called strncpy from its core code. For normal humans: this was a long-hated way of copying text that could behave in confusing ways, cause bugs, and waste time filling empty space. Linux 7.2 replaces it with a bunch of clearer, safer alternatives — and yes, the real fireworks were in the comment section.

The strongest reaction? A full-blown string-format identity crisis. One commenter declared that zero-terminated text — the ancient convention where text ends with a special invisible marker — might be “computing’s biggest mistake,” and started pining for Pascal-style strings like it was an ex returning to haunt the timeline. Another person dragged in old Win32 war stories about bizarre space-padded strings, basically saying, “You think this is messy? Let me tell you about legacy software from the crypt.”

Then came the open-source drama. One commenter fumed that Linux ignored the older strlcpy approach because of “petty open source bullshit,” which is exactly the kind of diplomatic language the internet is famous for. Others dreamed bigger, wondering if someone should just fork Linux and let automatic programming rewrite the whole thing. And in the background was the eternal hot take: why are we still using text systems from the stone age instead of storing the length separately like modern languages do? Linux may have won the cleanup battle, but the comments made it clear: the string wars are absolutely not over.

Key Points

  • Linux 7.2 removed the deprecated `strncpy()` API from the Linux kernel.
  • The article says `strncpy()` had long been a source of bugs because of counter-intuitive semantics, NUL-termination behavior, and redundant zero-filling.
  • Eliminating `strncpy()` usage across the kernel took about six years and roughly 362 commits.
  • A final merge removed both the API and the remaining per-CPU architecture-specific `strncpy()` implementations.
  • The article lists replacement APIs for different use cases: `strscpy()`, `strscpy_pad()`, `strtomem_pad()`, `memcpy_and_pad()`, and `memcpy()`.

Hottest takes

"computing's biggest mistake" — mrlonglong
"typical petty open source bullshit" — naturalmovement
"brave and fork the linux kernel" — larodi
Made with <3 by @siedrix and @shesho from CDMX. Powered by Forge&Hive.