Skip to content

Commit

Permalink
memset(): Make it clear 'c' is intepreted as 'unsigned char'
Browse files Browse the repository at this point in the history
No change in behavior due to existing implicit cast, but make it clear
that the character to set is interpreted as 'unsigned char', as per C99.
  • Loading branch information
ebiggers committed Sep 13, 2013
1 parent dd7c672 commit 0c750e9
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/libxc/memset.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,12 @@
void *memset(void *s, int c, size_t n)
{
unsigned char *p = s;
unsigned char byte = c;
size_t i;

for (i = 0; i < n; i++)
{
p[i] = c;
p[i] = byte;
}
return s;
}

0 comments on commit 0c750e9

Please sign in to comment.