From: Pekka Riikonen Date: Sat, 13 Dec 2008 20:30:25 +0000 (+0200) Subject: Merge branch 'topic/format-cleanup' of git://valera-ext.nynaeve.net/silc into silc... X-Git-Tag: silc.toolkit.1.1.9~6 X-Git-Url: http://git.silcnet.org/gitweb/?a=commitdiff_plain;h=85218febb1ac7e0debf505a35da45a8e55c336a1;hp=5b480c5339b4e5f52a0aa91c6a9e3c661466ebc8;p=silc.git Merge branch 'topic/format-cleanup' of git://valera-ext.nynaeve.net/silc into silc.1.1.branch --- diff --git a/apps/irssi/src/silc/core/client_ops.c b/apps/irssi/src/silc/core/client_ops.c index 16feddc7..cfefe327 100644 --- a/apps/irssi/src/silc/core/client_ops.c +++ b/apps/irssi/src/silc/core/client_ops.c @@ -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"); diff --git a/apps/silc/clientutil.c b/apps/silc/clientutil.c index 71b628bc..6a41a7c9 100644 --- a/apps/silc/clientutil.c +++ b/apps/silc/clientutil.c @@ -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++; } diff --git a/apps/silcd/server.c b/apps/silcd/server.c index 2f97d79d..2ed57078 100644 --- a/apps/silcd/server.c +++ b/apps/silcd/server.c @@ -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; } diff --git a/apps/silcd/serverconfig.c b/apps/silcd/serverconfig.c index 30d76af3..a2c58923 100644 --- a/apps/silcd/serverconfig.c +++ b/apps/silcd/serverconfig.c @@ -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); } diff --git a/apps/silcmap/silcmap_bitmap.c b/apps/silcmap/silcmap_bitmap.c index 6440f88d..b171f47b 100644 --- a/apps/silcmap/silcmap_bitmap.c +++ b/apps/silcmap/silcmap_bitmap.c @@ -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); diff --git a/lib/silcclient/client_entry.c b/lib/silcclient/client_entry.c index a7ec24ee..003f2fcf 100644 --- a/lib/silcclient/client_entry.c +++ b/lib/silcclient/client_entry.c @@ -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; } diff --git a/lib/silcclient/client_keyagr.c b/lib/silcclient/client_keyagr.c index 6a93b061..0d0ef8b4 100644 --- a/lib/silcclient/client_keyagr.c +++ b/lib/silcclient/client_keyagr.c @@ -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); diff --git a/lib/silchttp/silchttpserver.c b/lib/silchttp/silchttpserver.c index cd94c407..e83d2f37 100644 --- a/lib/silchttp/silchttpserver.c +++ b/lib/silchttp/silchttpserver.c @@ -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); diff --git a/lib/silcske/silcske.c b/lib/silcske/silcske.c index a4822e95..5cb7c91d 100644 --- a/lib/silcske/silcske.c +++ b/lib/silcske/silcske.c @@ -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)); /* diff --git a/lib/silcskr/silcskr.c b/lib/silcskr/silcskr.c index 327c6124..c9b4be0d 100644 --- a/lib/silcskr/silcskr.c +++ b/lib/silcskr/silcskr.c @@ -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) { diff --git a/lib/silcutil/silcschedule.c b/lib/silcutil/silcschedule.c index 6c2f78ca..8d9738de 100644 --- a/lib/silcutil/silcschedule.c +++ b/lib/silcutil/silcschedule.c @@ -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 diff --git a/lib/silcutil/silcsocketstream.c b/lib/silcutil/silcsocketstream.c index af8f2c34..95b969d9 100644 --- a/lib/silcutil/silcsocketstream.c +++ b/lib/silcutil/silcsocketstream.c @@ -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; diff --git a/lib/silcutil/unix/silcunixschedule.c b/lib/silcutil/unix/silcunixschedule.c index 80e8fbf2..bcbe1203 100644 --- a/lib/silcutil/unix/silcunixschedule.c +++ b/lib/silcutil/unix/silcunixschedule.c @@ -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) diff --git a/util/robodoc/Source/generator.c b/util/robodoc/Source/generator.c index 632c2990..2f9b9928 100644 --- a/util/robodoc/Source/generator.c +++ b/util/robodoc/Source/generator.c @@ -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, "%s", 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, "%s", 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, "%s", link, link);