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
- debian bookworm: publib-dev 0.40-3+b1 Β· BSD-2-Clause
- debian trixie: publib-dev 0.40-4 Β· BSD-2-Clause
- ubuntu jammy: publib-dev 0.40-3build1 Β· BSD-2-Clause
- ubuntu noble: publib-dev 0.40-3build1 Β· BSD-2-Clause
- ubuntu questing: publib-dev 0.40-4
- ubuntu resolute: publib-dev 0.40-4build1 Β· BSD-2-Clause
- ubuntu stonking: publib-dev 0.40-4build1 Β· BSD-2-Clause
- Copyright (c) 1994-2006 Lars Wirzenius. All rights reserved
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms