if (context->user.usernum == 0)
{ /* old system user with number 0, upgrade it */
context->user.usernum = get_new_user_number();
- CtdlLogPrintf(CTDL_DEBUG, "Upgrading system user \"%s\" from user number 0 to user number %d\n", context->user.fullname, context->user.usernum);
+ CtdlLogPrintf(CTDL_DEBUG, "Upgrading system user \"%s\" from user number 0 to user number %ld\n", context->user.fullname, context->user.usernum);
/* add user to the database */
CtdlPutUser(&(context->user));
cdb_store(CDB_USERSBYNUMBER, &(context->user.usernum), sizeof(long), context->user.fullname, strlen(context->user.fullname)+1);
unlink(CC->upl_path);
}
else {
- CtdlLogPrintf(CTDL_ALERT, "Cannot link %d to %d: %s\n",
+ CtdlLogPrintf(CTDL_ALERT, "Cannot link %s to %s: %s\n",
CC->upl_path, final_filename, strerror(errno)
);
}
HashPos = GetNewHashPos(tzidlist, 0);
while (GetNextHashPos(tzidlist, HashPos, &len, &Key, &Value)) {
- CtdlLogPrintf(CTDL_DEBUG, "Attaching timezone '%s'\n", Value);
+ CtdlLogPrintf(CTDL_DEBUG, "Attaching timezone '%s'\n", (char*) Value);
icaltimezone *t = NULL;
/* First look for a timezone attached to the original calendar */
HashPos = GetNewHashPos(keys, 0);
while (GetNextHashPos(keys, HashPos, &len, &Key, &Value)!=0)
{
- CtdlLogPrintf(CTDL_DEBUG, "Deleting associated OpenID <%s>\n", Value);
+ CtdlLogPrintf(CTDL_DEBUG, "Deleting associated OpenID <%s>\n", (char*)Value);
cdb_delete(CDB_OPENID, Value, strlen(Value));
/* note: don't free(Value) -- deleting the hash list will handle this for us */
++num_deleted;
}
if (citadel_migrate_data != 1) {
- CtdlLogPrintf(CTDL_ALERT, "Out-of-sequence tag <%s> detected. Warning: ODD-DATA!\n");
+ CtdlLogPrintf(CTDL_ALERT, "Out-of-sequence tag <%s> detected. Warning: ODD-DATA!\n", el);
return;
}
}
if (citadel_migrate_data != 1) {
- CtdlLogPrintf(CTDL_ALERT, "Out-of-sequence tag <%s> detected. Warning: ODD-DATA!\n");
+ CtdlLogPrintf(CTDL_ALERT, "Out-of-sequence tag <%s> detected. Warning: ODD-DATA!\n", el);
return;
}
cdb_free(cdboi);
if (fetched_usernum == who->usernum) {
- CtdlLogPrintf(CTDL_INFO, "%s already associated; no action is taken\n", claimed_id);
+ CtdlLogPrintf(CTDL_INFO, "%s already associated; no action is taken\n", ChrPtr(claimed_id));
return(0);
}
else {
- CtdlLogPrintf(CTDL_INFO, "%s already belongs to another user\n", claimed_id);
+ CtdlLogPrintf(CTDL_INFO, "%s already belongs to another user\n", ChrPtr(claimed_id));
return(3);
}
}
HashPos = GetNewHashPos(keys, 0);
while (GetNextHashPos(keys, HashPos, &len, &Key, &Value)!=0)
{
- CtdlLogPrintf(CTDL_DEBUG, "Deleting associated OpenID <%s>\n", Value);
+ CtdlLogPrintf(CTDL_DEBUG, "Deleting associated OpenID <%s>\n", (char*)Value);
cdb_delete(CDB_OPENID, Value, strlen(Value));
/* note: don't free(Value) -- deleting the hash list will handle this for us */
}
fseek(fp, 0L, SEEK_SET);
msg->cm_fields['M'] = malloc(len + 1);
rv = fread(msg->cm_fields['M'], len, 1, fp);
- CtdlLogPrintf(CTDL_DEBUG, "did %d blocks of %d bytes\n", rv, len);
+ CtdlLogPrintf(CTDL_DEBUG, "did %d blocks of %ld bytes\n", rv, len);
msg->cm_fields['M'][len] = 0;
fclose(fp);
}
void cprintf (const char *format, ...);
#endif
-void CtdlLogPrintf(enum LogLevel loglevel, const char *format, ...);
+void CtdlLogPrintf(enum LogLevel loglevel, const char *format, ...) __attribute__((__format__(__printf__,2,3)));
void vCtdlLogPrintf (enum LogLevel loglevel, const char *format, va_list arg_ptr);
extern int enable_syslog;
const char *name = CT->name;
const pid_t tid = CT->tid;
- CtdlLogPrintf(CTDL_NOTICE, "Thread \"%s\" (0x%08lx) exited.\n", name, tid);
+ CtdlLogPrintf(CTDL_NOTICE, "Thread \"%s\" (0x%08lx) exited.\n", name, (unsigned long) tid);
}
else
{
/*
* This thread is now used for garbage collection of other threads in the thread list
*/
- CtdlLogPrintf(CTDL_INFO, "Startup thread %d becoming garbage collector,\n", citthread_self());
+ CtdlLogPrintf(CTDL_INFO, "Startup thread %ld becoming garbage collector,\n", (long) citthread_self());
/*
* We do a lot of locking and unlocking of the thread list in here.