Skip to content

Commit

Permalink
Silence 3 warnings in libc.
Browse files Browse the repository at this point in the history
  • Loading branch information
Sascha Wildner committed Feb 3, 2009
1 parent 2480ead commit 761342f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/libc/gen/sysctlnametomib.c
Expand Up @@ -49,7 +49,7 @@ sysctlnametomib(const char *name, int *mibp, size_t *sizep)
oid[1] = 3;

*sizep *= sizeof (int);
error = sysctl(oid, 2, mibp, sizep, name, strlen(name));
error = sysctl(oid, 2, mibp, sizep, (void *)name, strlen(name));
*sizep /= sizeof (int);
if (error < 0)
return (error);
Expand Down
6 changes: 4 additions & 2 deletions lib/libc/locale/wcsftime.c
Expand Up @@ -53,6 +53,7 @@ wcsftime(wchar_t * __restrict wcs, size_t maxsize,
static const mbstate_t initial;
mbstate_t mbs;
char *dst, *dstp, *sformat;
const wchar_t *formatp;
size_t n, sflen;
int sverrno;

Expand All @@ -63,13 +64,14 @@ wcsftime(wchar_t * __restrict wcs, size_t maxsize,
* for strftime(), which only handles single-byte characters.
*/
mbs = initial;
sflen = wcsrtombs(NULL, &format, 0, &mbs);
formatp = format;
sflen = wcsrtombs(NULL, &formatp, 0, &mbs);
if (sflen == (size_t)-1)
goto error;
if ((sformat = malloc(sflen + 1)) == NULL)
goto error;
mbs = initial;
wcsrtombs(sformat, &format, sflen + 1, &mbs);
wcsrtombs(sformat, &formatp, sflen + 1, &mbs);

/*
* Allocate memory for longest multibyte sequence that will fit
Expand Down

0 comments on commit 761342f

Please sign in to comment.