changed all occurrences of unsigned char to byte (defined in defines.h) to make the code more precise about sizes.

This commit is contained in:
git@daemon.de
2014-02-25 11:09:58 +01:00
parent cbc45f5fa1
commit 3b1db06529
31 changed files with 243 additions and 240 deletions

View File

@@ -28,7 +28,7 @@ void *ucmalloc(size_t s) {
if (s == 0)
return NULL;
size_t size = s * sizeof(unsigned char);
size_t size = s * sizeof(byte);
void *value = malloc (size);
if (value == NULL) {
@@ -53,11 +53,11 @@ void *urmalloc(size_t s) {
void *ucrealloc(void *d, size_t oldlen, size_t newlen) {
newlen = newlen * sizeof(unsigned char);
newlen = newlen * sizeof(byte);
/* we're using a 1 byte sized pointer, so that we can
memset(zero) it after resizing */
unsigned char *value = realloc (d, newlen);
byte *value = realloc (d, newlen);
if (value == NULL) {
err(errno, "Cannot reallocate %ld bytes of memory", newlen);