Update of /cvsroot/blob/blob/include/blob
In directory usw-pr-cvs1:/tmp/cvs-serv30998/include/blob
Modified Files:
util.h
Log Message:
Remove strcpy() in favour of strncpy(). Again, this forces you to think before
you copy a string. The changes in the files are trivial again.
Index: util.h
===================================================================
RCS file: /cvsroot/blob/blob/include/blob/util.h,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- util.h 2001/12/19 19:03:45 1.5
+++ util.h 2001/12/19 20:00:15 1.6
@@ -44,7 +44,11 @@
int strncmp(const char *s1, const char *s2, int maxlen);
int strlen(const char *s);
-char *strcpy(char *dest, const char *src);
+
+char *strncpy(char *dest, const char *src, int n);
+
+/* same as strncpy(), but also null terminates the string */
+char *strlcpy(char *dest, const char *src, int n);
/* convert a string to an u32 value */
int strtou32(const char *str, u32 *value);
|