fix string function prototypes in libpayload according to sysv/4.3bsd.

Discussed on IRC, trivial

Signed-off-by: Stefan Reinauer <stepan@coresystems.de>
Acked-by: Stefan Reinauer <stepan@coresystems.de>



git-svn-id: svn://svn.coreboot.org/coreboot/trunk@3539 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
This commit is contained in:
Stefan Reinauer 2008-08-26 21:51:04 +00:00 committed by Stefan Reinauer
parent 54ec0afc1c
commit 3b9d1b83ab
2 changed files with 6 additions and 6 deletions

View File

@ -214,10 +214,10 @@ u8 *sha1(const u8 *data, size_t len, u8 *buf);
size_t strnlen(const char *str, size_t maxlen); size_t strnlen(const char *str, size_t maxlen);
size_t strlen(const char *str); size_t strlen(const char *str);
int strcmp(const char *s1, const char *s2); int strcmp(const char *s1, const char *s2);
int strncmp(const char *s1, const char *s2, int maxlen); int strncmp(const char *s1, const char *s2, size_t maxlen);
char *strncpy(char *d, const char *s, int n); char *strncpy(char *d, const char *s, size_t n);
char *strcpy(char *d, const char *s); char *strcpy(char *d, const char *s);
char *strncat(char *d, const char *s, int n); char *strncat(char *d, const char *s, size_t n);
char *strchr(const char *s, int c); char *strchr(const char *s, int c);
char *strdup(const char *s); char *strdup(const char *s);
char *strstr(const char *h, const char *n); char *strstr(const char *h, const char *n);

View File

@ -116,7 +116,7 @@ int strcmp(const char *s1, const char *s2)
* @param maxlen Return at most maxlen characters as length of the string. * @param maxlen Return at most maxlen characters as length of the string.
* @return A non-zero value if s1 and s2 differ, or zero if s1 equals s2. * @return A non-zero value if s1 and s2 differ, or zero if s1 equals s2.
*/ */
int strncmp(const char *s1, const char *s2, int maxlen) int strncmp(const char *s1, const char *s2, size_t maxlen)
{ {
int i; int i;
@ -128,7 +128,7 @@ int strncmp(const char *s1, const char *s2, int maxlen)
return 0; return 0;
} }
char *strncpy(char *d, const char *s, int n) char *strncpy(char *d, const char *s, size_t n)
{ {
/* Use +1 to get the NUL terminator. */ /* Use +1 to get the NUL terminator. */
int max = n > strlen(s) + 1 ? strlen(s) + 1 : n; int max = n > strlen(s) + 1 ? strlen(s) + 1 : n;
@ -145,7 +145,7 @@ char *strcpy(char *d, const char *s)
return strncpy(d, s, strlen(s) + 1); return strncpy(d, s, strlen(s) + 1);
} }
char *strncat(char *d, const char *s, int n) char *strncat(char *d, const char *s, size_t n)
{ {
char *p = d + strlen(d); char *p = d + strlen(d);
int max = n > strlen(s) ? strlen(s) : n; int max = n > strlen(s) ? strlen(s) : n;