diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2002-07-24 04:11:11 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2002-07-24 04:11:11 +0000 |
commit | f4836b6d05c454ec22dcd8656f58b151a3970047 (patch) | |
tree | 8d7df3890632232ec5b42601e7c334f120773cc1 /libexec/ld.so/util.h | |
parent | 2647b624657fb649232b187356361551c6b5af11 (diff) |
ok i found it
Diffstat (limited to 'libexec/ld.so/util.h')
-rw-r--r-- | libexec/ld.so/util.h | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/libexec/ld.so/util.h b/libexec/ld.so/util.h index 53118a25238..62041200412 100644 --- a/libexec/ld.so/util.h +++ b/libexec/ld.so/util.h @@ -1,4 +1,4 @@ -/* $OpenBSD: util.h,v 1.9 2002/07/24 04:00:44 deraadt Exp $ */ +/* $OpenBSD: util.h,v 1.10 2002/07/24 04:11:10 deraadt Exp $ */ /* * Copyright (c) 1998 Todd C. Miller <Todd.Miller@courtesan.com> @@ -36,8 +36,7 @@ #ifndef __DL_UTIL_H__ #define __DL_UTIL_H__ -int _dl_write(int, const char *, int); -void *_dl_malloc(const int size); +void *_dl_malloc(const size_t size); void _dl_free(void *); char *_dl_strdup(const char *); void _dl_printf(const char *fmt, ...); @@ -57,12 +56,12 @@ _dl_wrstderr(const char *s) } static inline void * -_dl_memset(void *p, const char v, size_t c) +_dl_memset(void *p, const int v, size_t c) { char *ip = p; while (c--) - *ip++ = v; + *ip++ = (char)v; return(p); } @@ -77,7 +76,7 @@ _dl_strlen(const char *p) } static inline size_t -_dl_strlcpy(char *dst, const char *src, int siz) +_dl_strlcpy(char *dst, const char *src, size_t siz) { char *d = dst; const char *s = src; @@ -103,13 +102,13 @@ _dl_strlcpy(char *dst, const char *src, int siz) } static inline int -_dl_strncmp(const char *d, const char *s, int c) +_dl_strncmp(const char *d, const char *s, size_t len) { - while (c-- && *d && *d == *s) { + while (len-- && *d && *d == *s) { d++; s++; } - if (c < 0) + if (len < 0) return(0); return(*d - *s); } |