i'll probably regret asking but what's wrong with strcpy and what should you use instead then
@squirrel Someone at Microsoft once had a buffer overrun bug because they didn't check their strcmp and they will never let anyone forget it ever.
@squirrel ...and instead you should disable the compiler warning and just use strcmp anyway. ;)
@squirrel Oops I said strcmp instead of strcpy.
On unixy systems there was strlcpy, on MSVC there was strcpy_s, though with C++11 strcpy_s is now standard I think?
For years the solution was to have your own version of strcpy that had different implementation on each platform. :S
@squirrel Oh wait no, strcpy_s doesn't truncate, it just makes an empty string if it was too long. D:
Then there's a series of other mistakes by microsoft like lstrcopy and StringCchCopy and aaaaaaa I guess the cross-platform solution is still to write your own. :P (Or abandon MSVC and use strlcpy.)
@squirrel ...or tell the compiler to shut up and use strcpy anyway.
@squirrel from looking around it looks like strcpy doesn't check the length of the destination buffer and so could lead to overflows?
I've heard strlcpy advised but I don't know C so I have no idea if that's a good idea or not