Home
Highly Reusable Software By activity User Interface Text Strings Math Processing
Stored Data
Communications
Hard World File System
|
#License - #Source code - #Example Use -
#include <librock/parse.h> char * librock_strn0cpy( char *dest, const char *src, int n );
Returns the first argument. This does not '\0' fill dest[> strlen(src)] as some strncpy implementations do.
Typical use is to replace clumsy two-step calls to strncpy such as:
strncpy(dest,src,sizeof(dest)); dest[sizeof(dest)-1] = '\0';with:
librock_strn0cpy(dest,src,sizeof(dest-1));If you don't want the '\0', then use memmove()
// [Makes no calls]
Copyright 1998-2004 Forrest J. Cavalier III, http://www.mibsoftware.com Open-source under MIT license. NO WARRANTY. Copies must retain this block. License, originals, details: http://www.mibsoftware.com/librock/
Verbatim copying and distribution of this generated page is permitted in any medium provided that no changes are made.
(The source of this manual page may be covered by a more permissive license which allows modifications.)
Want to help? We welcome comments, patches. -- Need help? Request paid support.