Commit 06c80621 authored by Benno Schulenberg's avatar Benno Schulenberg
Browse files

tweaks: improve two comments

No related merge requests found
Showing with 3 additions and 3 deletions
+3 -3
...@@ -404,8 +404,8 @@ void *nrealloc(void *ptr, size_t howmuch) ...@@ -404,8 +404,8 @@ void *nrealloc(void *ptr, size_t howmuch)
return r; return r;
} }
/* Copy the first n characters of one malloc()ed string to another /* Allocate and copy the first n characters of the given src string, after
* pointer. Should be used as: "dest = mallocstrncpy(dest, src, n);". */ * freeing the destination. Usage: "dest = mallocstrncpy(dest, src, n);". */
char *mallocstrncpy(char *dest, const char *src, size_t n) char *mallocstrncpy(char *dest, const char *src, size_t n)
{ {
if (src == NULL) if (src == NULL)
...@@ -420,7 +420,7 @@ char *mallocstrncpy(char *dest, const char *src, size_t n) ...@@ -420,7 +420,7 @@ char *mallocstrncpy(char *dest, const char *src, size_t n)
return dest; return dest;
} }
/* Copy one malloc()ed string to another pointer. Should be used as: /* Free the dest string and return a malloc'ed copy of src. Should be used as:
* "dest = mallocstrcpy(dest, src);". */ * "dest = mallocstrcpy(dest, src);". */
char *mallocstrcpy(char *dest, const char *src) char *mallocstrcpy(char *dest, const char *src)
{ {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment