Merge branch 'topic/format-cleanup' of git://valera-ext.nynaeve.net/silc into silc...
authorPekka Riikonen <priikone@silcnet.org>
Sat, 13 Dec 2008 20:30:25 +0000 (22:30 +0200)
committerPekka Riikonen <priikone@silcnet.org>
Sat, 13 Dec 2008 20:30:25 +0000 (22:30 +0200)
14 files changed:
apps/irssi/src/silc/core/client_ops.c
apps/silc/clientutil.c
apps/silcd/server.c
apps/silcd/serverconfig.c
apps/silcmap/silcmap_bitmap.c
lib/silcclient/client_entry.c
lib/silcclient/client_keyagr.c
lib/silchttp/silchttpserver.c
lib/silcske/silcske.c
lib/silcskr/silcskr.c
lib/silcutil/silcschedule.c
lib/silcutil/silcsocketstream.c
lib/silcutil/unix/silcunixschedule.c
util/robodoc/Source/generator.c

index 16feddc7583a8b2c18dd200f736473b2a8ba6d92..cfefe3275300b7e98db354c1ec378c3128b751b9 100644 (file)
@@ -1677,7 +1677,7 @@ void silc_command_reply(SilcClient client, SilcClientConnection conn,
 
       if (idle && nickname) {
        memset(buf, 0, sizeof(buf));
-       snprintf(buf, sizeof(buf) - 1, "%lu %s",
+       snprintf(buf, sizeof(buf) - 1, "%u %s",
                 idle > 60 ? (idle / 60) : idle,
                 idle > 60 ? "minutes" : "seconds");
 
index 71b628bc4aacf7d35d8b689140700ef790cd3ce6..6a41a7c93970025b48b825e2f2d29f656db80f79 100644 (file)
@@ -113,7 +113,7 @@ int silc_get_number_of_emails()
   if (!tl) {
     fprintf(stderr, "Couldn't open mail file (%s).\n", filename);
   } else {
-    while((fscanf(tl, "%s", data)) != EOF) { 
+    while((fscanf(tl, "%1023s", data)) != EOF) {
       if(!strcmp(data, "From:"))
        num++;
     }
index 2f97d79d837aaeee25893ad676f2f5cd1dab382d..2ed570783b6030c8a28b4299859d0398a4c70555 100644 (file)
@@ -5030,7 +5030,7 @@ void silc_server_save_users_on_channel(SilcServer server,
     }
 
     if (!(client->data.status & SILC_IDLIST_STATUS_REGISTERED)) {
-      SILC_LOG_ERROR(("Attempting to add unregistered client to channel ",
+      SILC_LOG_ERROR(("Attempting to add unregistered client to channel "
                      "%s", channel->channel_name));
       continue;
     }
index 30d76af3516cae4c81cbb60a718e938cc66fadf3..a2c589235bc7bfb28ffaee10f62c3f1706815d07 100644 (file)
@@ -1542,7 +1542,7 @@ SilcServerConfig silc_server_config_alloc(const char *filename,
                               silc_config_strerror(ret)));
       linebuf = silc_config_read_line(file, line);
       if (linebuf) {
-       SILC_SERVER_LOG_ERROR(("  file %s line %lu:  %s\n", filename,
+       SILC_SERVER_LOG_ERROR(("  file %s line %u:  %s\n", filename,
                               line, linebuf));
        silc_free(linebuf);
       }
index 6440f88ddcc8e6208d3263f2ad5ce07428cca756..b171f47bed1f77a178a0988410980137c35942b9 100644 (file)
@@ -52,7 +52,7 @@ bool silc_map_load_ppm(SilcMap map, const char *filename)
   }
 
   /* Read width and height */
-  ret = sscanf(header, "%s %ld %ld %ld\n", type,
+  ret = sscanf(header, "%2s %ld %ld %ld\n", type,
               (unsigned long *)&map->width,
               (unsigned long *)&map->height,
               (unsigned long *)&map->maxcolor);
index a7ec24ee2701801ad02b235fe6c773a54bc37149..003f2fcfd03116ab2d92b18b4c1421dbfc3383e6 100644 (file)
@@ -1019,10 +1019,10 @@ SilcBool silc_client_del_client(SilcClient client, SilcClientConnection conn,
   if (!client_entry)
     return FALSE;
 
-  SILC_LOG_DEBUG(("Marking client entry %p deleted"));
+  SILC_LOG_DEBUG(("Marking client entry %p deleted", client_entry));
 
   if (silc_atomic_sub_int32(&client_entry->internal.deleted, 1) != 0) {
-    SILC_LOG_DEBUG(("Client entry %p already marked deleted"));
+    SILC_LOG_DEBUG(("Client entry %p already marked deleted", client_entry));
     return FALSE;
   }
 
@@ -1722,10 +1722,10 @@ SilcBool silc_client_del_channel(SilcClient client, SilcClientConnection conn,
   if (!channel)
     return FALSE;
 
-  SILC_LOG_DEBUG(("Marking channel entry %p deleted"));
+  SILC_LOG_DEBUG(("Marking channel entry %p deleted", channel));
 
   if (silc_atomic_sub_int32(&channel->internal.deleted, 1) != 0) {
-    SILC_LOG_DEBUG(("Channel entry %p already marked deleted"));
+    SILC_LOG_DEBUG(("Channel entry %p already marked deleted", channel));
     return FALSE;
   }
 
index 6a93b061278022fb497d49a546c4e377de4650e7..0d0ef8b4481bbb23ece9d3da1672616174d80864 100644 (file)
@@ -368,7 +368,8 @@ void silc_client_abort_key_agreement(SilcClient client,
 
   ke = client_entry->internal.ke;
 
-  SILC_LOG_DEBUG(("Abort key agreement %p"));
+  SILC_LOG_DEBUG(("Abort key agreement ke %p for client %p on connection %p",
+                  ke, client, conn));
 
   ke->completion(client, conn, client_entry,
                 SILC_KEY_AGREEMENT_ABORTED, NULL, ke->context);
index cd94c407f4f3d7f53dfd06961c2daf46eb8a1400..e83d2f379b274f1106774bbc754ecb98ecf8482d 100644 (file)
@@ -194,7 +194,7 @@ static SilcBool silc_http_server_parse(SilcHttpServer httpd,
 
     /* Check we have received all data */
     cl = silc_mime_get_field(conn->curheaders, "Content-Length");
-    if (cl && sscanf(cl, "%lu", (unsigned long *)&cll) == 1) {
+    if (cl && sscanf(cl, "%u", &cll) == 1) {
       if (data_len < cll) {
        /* More data to come */
        silc_mime_free(conn->curheaders);
index a4822e95a505a8cb709d6d63bfb0f4eabf9e8f0f..5cb7c91d9c7f908aa8313d2cb6e3383165f079cf 100644 (file)
@@ -80,7 +80,7 @@ static SilcBool silc_ske_packet_send(SilcSKE ske,
  */
 static void silc_ske_notify_failure(SilcSKE ske)
 {
-  SILC_LOG_DEBUG(("Notifying SKE %p owner of failure (failure_notified = %lu)",
+  SILC_LOG_DEBUG(("Notifying SKE %p owner of failure (failure_notified = %d)",
                  ske, ske->failure_notified));
 
   /*
index 327c61244b6f48b9e30850e01609c2a3f60b44bd..c9b4be0d17415714a84a052cbec2926a24b2a2c7 100644 (file)
@@ -748,7 +748,7 @@ void silc_skr_ref_public_key(SilcSKR skr, SilcSKRKey key)
   SilcSKRKeyInternal k = (SilcSKRKeyInternal)key;
 
   silc_mutex_lock(skr->lock);
-  SILC_LOG_DEBUG(("SKR key %p ref %d -> %d", k->refcnt, k->refcnt + 1));
+  SILC_LOG_DEBUG(("SKR key %p ref %d -> %d", k, k->refcnt, k->refcnt + 1));
   k->refcnt++;
   silc_mutex_unlock(skr->lock);
 }
@@ -761,7 +761,7 @@ void silc_skr_unref_public_key(SilcSKR skr, SilcSKRKey key)
 
   silc_mutex_lock(skr->lock);
 
-  SILC_LOG_DEBUG(("SKR key %p ref %d -> %d", k->refcnt, k->refcnt - 1));
+  SILC_LOG_DEBUG(("SKR key %p ref %d -> %d", k, k->refcnt, k->refcnt - 1));
   k->refcnt--;
 
   if (k->refcnt == 0) {
index 6c2f78ca840ed05982bcd56591f76b9809223f3a..8d9738debdc7e214a1ba4b8aa29d8e3c4e2e9ccc 100644 (file)
@@ -186,7 +186,7 @@ static void silc_schedule_select_timeout(SilcSchedule schedule)
   if (task) {
     schedule->timeout = curtime;
     schedule->has_timeout = TRUE;
-    SILC_LOG_DEBUG(("timeout: sec=%d, usec=%d", schedule->timeout.tv_sec,
+    SILC_LOG_DEBUG(("timeout: sec=%ld, usec=%ld", schedule->timeout.tv_sec,
                    schedule->timeout.tv_usec));
   }
 }
@@ -290,7 +290,7 @@ void silc_schedule_stats(SilcSchedule schedule)
 {
   SilcTaskFd ftask;
   fprintf(stdout, "Schedule %p statistics:\n\n", schedule);
-  fprintf(stdout, "Num FD tasks         : %lu (%lu bytes allocated)\n",
+  fprintf(stdout, "Num FD tasks         : %u (%u bytes allocated)\n",
          silc_hash_table_count(schedule->fd_queue),
          sizeof(*ftask) * silc_hash_table_count(schedule->fd_queue));
   fprintf(stdout, "Num Timeout tasks    : %d (%d bytes allocated)\n",
@@ -600,7 +600,7 @@ SilcTask silc_schedule_task_add(SilcSchedule schedule, SilcUInt32 fd,
       }
     }
 
-    SILC_LOG_DEBUG(("New timeout task %p: sec=%d, usec=%d", ttask,
+    SILC_LOG_DEBUG(("New timeout task %p: sec=%ld, usec=%ld", ttask,
                    seconds, useconds));
 
     /* Add task to correct spot so that the first task in the list has
index af8f2c34cba0b60f6584b07dd57b10931fe115ab..95b969d9ab9388b93309f36e1630b6ef659bf620 100644 (file)
@@ -166,7 +166,7 @@ silc_socket_tcp_stream_create(SilcSocket sock, SilcBool lookup,
     return NULL;
   }
 
-  SILC_LOG_DEBUG(("Creating TCP socket stream %p, sock %lu", stream, sock));
+  SILC_LOG_DEBUG(("Creating TCP socket stream %p, sock %lu", stream, (long unsigned) sock));
 
   stream->ops = &silc_socket_stream_ops;
   stream->sock = sock;
index 80e8fbf264e9a471a1732ef98b1c3c7546f8f65e..bcbe120331cdca96dcad834c4250dc95c55e8c49 100644 (file)
@@ -274,7 +274,7 @@ SilcBool silc_schedule_internal_schedule_fd(SilcSchedule schedule,
   if (!internal)
     return TRUE;
 
-  SILC_LOG_DEBUG(("Scheduling fd %lu, mask %x", task->fd, event_mask));
+  SILC_LOG_DEBUG(("Scheduling fd %u, mask %x", task->fd, event_mask));
 
   memset(&event, 0, sizeof(event));
   if (event_mask & SILC_TASK_READ)
index 632c2990f94c880e285de6fc97da3534cfec23a6..2f9b9928755f71bb2b0396b6cf53047dff7085d0 100644 (file)
@@ -1403,7 +1403,7 @@ RB_HTML_Extra (FILE * dest_doc, int item_type, char *cur_char)
 
   if (strncmp ("http://", cur_char, strlen ("http://")) == 0)
     {
-      sscanf (cur_char, "%s", link);
+      sscanf (cur_char, "%1023s", link);
       RB_Say ("found link %s\n", link);
       res = (strlen (link) - 1);
       fprintf (dest_doc, "<A HREF=\"%s\">%s</A>", link, link);
@@ -1411,14 +1411,14 @@ RB_HTML_Extra (FILE * dest_doc, int item_type, char *cur_char)
   else if (strncmp ("href:", cur_char, strlen ("href:")) == 0)
     {
       /* handy in relative hyperlink paths, e.g. href:../../modulex/ */
-      sscanf ((cur_char + strlen ("href:")), "%s", link);
+      sscanf ((cur_char + strlen ("href:")), "%1023s", link);
       RB_Say ("found link %s\n", link);
       res = (strlen (link) + strlen ("href:") - 1);
       fprintf (dest_doc, "<A HREF=\"%s\">%s</A>", link, link);
     }
   else if (strncmp ("mailto:", cur_char, strlen ("mailto:")) == 0)
     {
-      sscanf ((cur_char + strlen ("mailto:")), "%s", link);
+      sscanf ((cur_char + strlen ("mailto:")), "%1023s", link);
       RB_Say ("found mail to %s\n", link);
       res = (strlen (link) + strlen ("mailto:") - 1);
       fprintf (dest_doc, "<A HREF=\"mailto:%s\">%s</A>", link, link);