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");
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++;
}
}
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;
}
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);
}
}
/* 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);
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;
}
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;
}
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);
/* 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);
*/
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));
/*
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);
}
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) {
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));
}
}
{
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",
}
}
- 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
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;
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)
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);
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);