X-Git-Url: http://git.silcnet.org/gitweb/?a=blobdiff_plain;f=lib%2Fsilcutil%2Fsilcutil.c;h=04b1036358433e3163c75ef64076f2b412cb5985;hb=9905799a86c606304fd7df2cd401de1740a272a1;hp=ebec35a77cc2c840d5f84c728691d6fd97f36e1a;hpb=b2ebed4324541ee73e431f9f9f9f8b9b99898236;p=silc.git diff --git a/lib/silcutil/silcutil.c b/lib/silcutil/silcutil.c index ebec35a7..04b10363 100644 --- a/lib/silcutil/silcutil.c +++ b/lib/silcutil/silcutil.c @@ -4,7 +4,7 @@ Author: Pekka Riikonen - Copyright (C) 1997 - 2006 Pekka Riikonen + Copyright (C) 1997 - 2007 Pekka Riikonen This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -88,7 +88,7 @@ SilcBool silc_to_upper(const char *string, char *dest, SilcUInt32 dest_size) return FALSE; for (i = 0; i < strlen(string); i++) - dest[i] = toupper(string[i]); + dest[i] = (char)toupper((int)string[i]); return TRUE; } @@ -103,7 +103,7 @@ SilcBool silc_to_lower(const char *string, char *dest, SilcUInt32 dest_size) return FALSE; for (i = 0; i < strlen(string); i++) - dest[i] = tolower(string[i]); + dest[i] = (char)tolower((int)string[i]); return TRUE; } @@ -236,7 +236,7 @@ char *silc_format(char *fmt, ...) memset(buf, 0, sizeof(buf)); va_start(args, fmt); - vsnprintf(buf, sizeof(buf) - 1, fmt, args); + vsilc_snprintf(buf, sizeof(buf) - 1, fmt, args); va_end(args); return strdup(buf); @@ -253,7 +253,7 @@ SilcUInt32 silc_hash_string(void *key, void *user_context) SilcUInt32 h = 0, g; while (*s != '\0') { - h = (h << 4) + tolower(*s); + h = (h << 4) + tolower((int)*s); if ((g = h & 0xf0000000)) { h = h ^ (g >> 24); h = h ^ g; @@ -473,14 +473,14 @@ char *silc_fingerprint(const unsigned char *data, SilcUInt32 data_len) memset(fingerprint, 0, sizeof(fingerprint)); cp = fingerprint; for (i = 0; i < data_len; i++) { - snprintf(cp, sizeof(fingerprint), "%02X", data[i]); + silc_silc_snprintf(cp, sizeof(fingerprint), "%02X", data[i]); cp += 2; if ((i + 1) % 2 == 0) - snprintf(cp++, sizeof(fingerprint), " "); + silc_silc_snprintf(cp++, sizeof(fingerprint), " "); if ((i + 1) % 10 == 0) - snprintf(cp++, sizeof(fingerprint), " "); + silc_silc_snprintf(cp++, sizeof(fingerprint), " "); } i--; if ((i + 1) % 2 == 0)