From: Pekka Riikonen Date: Thu, 11 Sep 2008 15:47:55 +0000 (+0300) Subject: Merge branch 'topic/code-cleanup' of git://208.110.73.182/silc into silc.1.1.branch X-Git-Tag: silc.server.1.1.12~3 X-Git-Url: http://git.silcnet.org/gitweb/?p=silc.git;a=commitdiff_plain;h=ef4a33392664b8267f808b69c5d1e5565076ad76;hp=1cc9af890006b0181913d4f84909442744476745 Merge branch 'topic/code-cleanup' of git://208.110.73.182/silc into silc.1.1.branch --- diff --git a/apps/silcd/silcd.c b/apps/silcd/silcd.c index 19ba9193..d367328c 100644 --- a/apps/silcd/silcd.c +++ b/apps/silcd/silcd.c @@ -745,8 +745,8 @@ int main(int argc, char **argv) silc_file_writefile(pidfile, buf, strlen(buf)); } - silc_server_drop_privs(silcd); } + silc_server_drop_privs(silcd); /* Run the server. When this returns the server has been stopped and we will exit. */ diff --git a/lib/silcasn1/silcasn1.c b/lib/silcasn1/silcasn1.c index 5965228b..2e43b49c 100644 --- a/lib/silcasn1/silcasn1.c +++ b/lib/silcasn1/silcasn1.c @@ -53,7 +53,7 @@ SilcBool silc_asn1_init(SilcAsn1 asn1) asn1->stack2 = silc_stack_alloc(768); if (!asn1->stack2) { - silc_stack_free(asn1->stack2); + silc_stack_free(asn1->stack1); return FALSE; } diff --git a/lib/silcasn1/silcasn1_encode.c b/lib/silcasn1/silcasn1_encode.c index 11b963ec..986909c4 100644 --- a/lib/silcasn1/silcasn1_encode.c +++ b/lib/silcasn1/silcasn1_encode.c @@ -351,7 +351,7 @@ silc_asn1_encoder(SilcAsn1 asn1, SilcStack stack1, SilcStack stack2, /* Get OID words from the string */ cp = strchr(oidstr, '.'); while (cp) { - if (sscanf(oidstr, "%lu", (unsigned long *)&oid) != 1) { + if (sscanf(oidstr, "%u", &oid) != 1) { SILC_LOG_DEBUG(("Malformed OID string")); goto fail; } @@ -362,7 +362,7 @@ silc_asn1_encoder(SilcAsn1 asn1, SilcStack stack1, SilcStack stack2, cp = strchr(oidstr, '.'); if (!cp) { - if (sscanf(oidstr, "%lu", (unsigned long *)&oid) != 1) { + if (sscanf(oidstr, "%u", &oid) != 1) { SILC_LOG_DEBUG(("Malformed OID string")); goto fail; } diff --git a/lib/silcclient/client_channel.c b/lib/silcclient/client_channel.c index 32dac873..4120695d 100644 --- a/lib/silcclient/client_channel.c +++ b/lib/silcclient/client_channel.c @@ -630,7 +630,7 @@ SilcBool silc_client_del_channel_private_keys(SilcClient client, channel->cipher = silc_cipher_get_name(channel->internal.send_key); else channel->cipher = NULL; - if (channel->hmac) + if (channel->internal.hmac) channel->hmac = silc_hmac_get_name(channel->internal.hmac); else channel->hmac = NULL; diff --git a/lib/silcutil/silctypes.h b/lib/silcutil/silctypes.h index 70bc3016..d7f97976 100644 --- a/lib/silcutil/silctypes.h +++ b/lib/silcutil/silctypes.h @@ -177,14 +177,14 @@ typedef signed short SilcInt16; * * SOURCE */ -#if SILC_SIZEOF_LONG == 4 -typedef unsigned long SilcUInt32; -typedef signed long SilcInt32; -#else #if SILC_SIZEOF_INT == 4 typedef unsigned int SilcUInt32; typedef signed int SilcInt32; #else +#if SILC_SIZEOF_LONG == 4 +typedef unsigned long SilcUInt32; +typedef signed long SilcInt32; +#else #if SILC_SIZEOF_LONG_LONG >= 4 #ifndef WIN32 typedef unsigned long long SilcUInt32; @@ -634,4 +634,11 @@ do { \ #endif /***/ +typedef char __check_size1[sizeof(SilcInt8) == 1 ? 1 : -1]; +typedef char __check_size2[sizeof(SilcUInt8) == 1 ? 1 : -1]; +typedef char __check_size3[sizeof(SilcInt16) == 2 ? 1 : -1]; +typedef char __check_size4[sizeof(SilcUInt16) == 2 ? 1 : -1]; +typedef char __check_size5[sizeof(SilcInt32) == 4 ? 1 : -1]; +typedef char __check_size6[sizeof(SilcUInt32) == 4 ? 1 : -1]; + #endif /* SILCTYPES_H */