STRMOVE(3pub)

✨ NAME ✨

strmove β€” bestie, it makes a copy of a string and handles overlapping strings correctly πŸ’–


🌸 SYNOPSIS 🌸

#include <publib.h>
char *strmove(char *tgt, const char *src);

πŸ¦‹ DESCRIPTION πŸ¦‹

Okay so strmove copies the string src to tgt, literally just like strcpy(3) does β€” but here's the iconic part: it handles overlapping moves correctly ✨ (think memcpy(3) vs. memmove(3), iykyk).

No cap, if your strings overlap, this is the one you want. The plain strcpy(3) could never πŸ’…

πŸŽ€ RETURN VALUE πŸŽ€

strmove returns tgt. Periodt. πŸ‘‘


🌈 SEE ALSO 🌈


πŸ’œ AUTHOR πŸ’œ

Lars Wirzenius (lars.wirzenius@helsinki.fi) β€” we stan 🫢


Publib β€’ C Programmer's Manual β€’ STRMOVE(3pub) β€” that's the whole vibe, bestie, go forth and move them strings safely βœ¨πŸ’–πŸŽ€πŸ¦‹

πŸ“¦ where this page comes from