diff options
-rw-r--r-- | AuFileName.c | 6 | ||||
-rw-r--r-- | AuRead.c | 4 | ||||
-rw-r--r-- | AuWrite.c | 4 |
3 files changed, 7 insertions, 7 deletions
diff --git a/AuFileName.c b/AuFileName.c index bc7b177..473fad1 100644 --- a/AuFileName.c +++ b/AuFileName.c @@ -45,12 +45,12 @@ XauFileName (void) { const char *slashDotXauthority = "/.Xauthority"; char *name; - static int bsize; + static size_t bsize; static int atexit_registered = 0; #ifdef WIN32 char dir[128]; #endif - int size; + size_t size; if ((name = getenv ("XAUTHORITY"))) return name; @@ -70,7 +70,7 @@ XauFileName (void) if (size > bsize) { if (buf) free (buf); - buf = malloc ((unsigned) size); + buf = malloc (size); if (!buf) return NULL; @@ -35,7 +35,7 @@ read_short (unsigned short *shortp, FILE *file) { unsigned char file_short[2]; - if (fread ((char *) file_short, (int) sizeof (file_short), 1, file) != 1) + if (fread ((char *) file_short, sizeof (file_short), 1, file) != 1) return 0; *shortp = file_short[0] * 256 + file_short[1]; return 1; @@ -55,7 +55,7 @@ read_counted_string (unsigned short *countp, char **stringp, FILE *file) data = malloc ((unsigned) len); if (!data) return 0; - if (fread (data, (int) sizeof (char), (int) len, file) != len) { + if (fread (data, sizeof (char), len, file) != len) { bzero (data, len); free (data); return 0; @@ -36,7 +36,7 @@ write_short (unsigned short s, FILE *file) file_short[0] = (s & (unsigned)0xff00) >> 8; file_short[1] = s & 0xff; - if (fwrite ((char *) file_short, (int) sizeof (file_short), 1, file) != 1) + if (fwrite ((char *) file_short, sizeof (file_short), 1, file) != 1) return 0; return 1; } @@ -46,7 +46,7 @@ write_counted_string (unsigned short count, char *string, FILE *file) { if (write_short (count, file) == 0) return 0; - if (fwrite (string, (int) sizeof (char), (int) count, file) != count) + if (fwrite (string, sizeof (char), count, file) != count) return 0; return 1; } |