This is the mail archive of the libc-help@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Copying and concatenating strings with str5 functions


Dear maintainers,

Today, string copy/concatenation remains a problem. I suggest an
alternative to strncpy/strncat (strn) and strlcpy/strlcat (strl)
functions.

Str5cpy/str5cat functions are:
- C89 compliant
- Safer and easier to use than strn/strl functions
- Transparent (no silent unwanted behaviour) and orthogonal (uniform behaviour).

They return a meaningful return value and produce auto-documented source code.

Please, take a look to the str5 functions and the companion document:

http://aral.iut-rodez.fr/en/sanchis/miscellaneous/str5/str5.html


Using strcpy/strcat in simple cases and str5cpy/str5cat in tricky
situations could be a good compromise.

Sincerely yours,

Eric Sanchis
University of Toulouse Capitole (IUT de Rodez)


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]