Merge branch 'topic/null-fixes' of git://208.110.73.182/silc into silc.1.1.branch
authorPekka Riikonen <priikone@silcnet.org>
Thu, 11 Sep 2008 15:41:51 +0000 (18:41 +0300)
committerPekka Riikonen <priikone@silcnet.org>
Thu, 11 Sep 2008 15:41:51 +0000 (18:41 +0300)
apps/silcd/silcd.c
lib/silcasn1/silcasn1_encode.c
lib/silcutil/silctypes.h

index 19ba9193c4c14235d7a9aa99759f4f8aef0036f6..d367328c6578fdb15942f922e108a2fc7525e4de 100644 (file)
@@ -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. */
index 11b963ecb6fca8139a54caa5621376aef740f64d..986909c4d7348cdd43e4146dc9cb9f217510e381 100644 (file)
@@ -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;
            }
index 70bc30165b4a41c530fa8508a90788184c47dd71..d7f979766577c666ee2e5f6726ab4f2727bb28a4 100644 (file)
@@ -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 */