Work in progress: 181,232 of 181,233 sites checked so far, more every week · updated 2 Nov 2026Missing a blog? Tell us

Top all-time · #21082

T

The Flat Trantor Society

Personal blog · the-flat-trantor-society.blogspot.comprogramming

The Flat Trantor Society is a personal blog at the-flat-trantor-society.blogspot.com about programming. Since 2015, 3 different Hacker News readers have linked it 8 times, most often “Strncpy() is not a “safer” strcpy()”. The last post was in 2014, but the archive is still widely read.

Visit the blog
8mentions?
3HN people?
2015–2021first – last linked?
Links on Hacker News per year · peak 2 in 2015

Rants and musings on software

Most-linked posts?

  1. Strncpy() is not a “safer” strcpy()
    2 people · 6 mentions · first linked 2015-06-01

What Hacker News says?

  1. strncpy() is not a "safer" strcpy(). It can avoid some errors involving writing past the end of the target array ( if you tell it the correct length for that array), but it's not a true string function, and it can leave the target unterminated and therefore not a valid string. http://the-flat-trantor-society.blogspot.com/2012/03/no-strn...

    Comment linking /2012/03/no-strncpy-is-not-safer-strcpy.html

    on “Git's list of banned C functions”
  2. Submitted Strncpy() is not a “safer” strcpy() as a story · 56 points

    HN discussion
  3. NULL is (a macro that expands to) a null pointer constant. The null character '\0' is commonly called NUL. I've written about strncpy: http://the-flat-trantor-society.blogspot.com/2012/03/no-strn...

    Comment linking /2012/03/no-strncpy-is-not-safer-strcpy.html

    on “Massacring C Pointers”
  4. Submitted strncpy() is not a safer strcpy() (2012) as a story · 32 points

    HN discussion
  5. "always use strncpy" I disagree; you should almost never use strncpy. Its name implies that it's a "safer" version of strcpy, but that's not what it is at all. If the target array isn't big enough, it can easily end up not containing a null-terminated string. As it happens, I wrote about this a few years ago. http://the-flat-trantor-society.blogspot.com/2012/03/no-strn...

    Comment linking /2012/03/no-strncpy-is-not-safer-strcpy.html

    on “C Primer”
  6. Here's my rant on strncpy: http://the-flat-trantor-society.blogspot.com/2012/03/no-strn...

    Comment linking /2012/03/no-strncpy-is-not-safer-strcpy.html

    on “Inside the C Standard Library”
  7. I always remap caps-lock to act like the control key. I posted an article on how to do this on various systems (some of the information might be outdated): https://the-flat-trantor-society.blogspot.com/2013/12/where-...

    Comment linking /2013/12/where-should-control-key-be.html

    on “The Joys of Unix Keyboards”
  8. Part 3: "Wait a tic... Where's the Makefile? I've got just about as much chance of finding it as the FBI does of finding Jimmy Hoffa. Am I just supposed to imagine it into existence?" I think the point is that the make command can use implicit rules even if there is no Makefile. It knows how to compile C source files. (This could be confusing if you know about "make" but don't know about implicit rules.) For example…

    Comment linking /2012/03/no-strncpy-is-not-safer-strcpy.html

    on “Don't Learn C the Wrong Way”

Search all of HN for the-flat-trantor-society.blogspot.com