Fix format warnings in log_message() calls

master
Pavel Roskin 9 years ago
parent b1527b7947
commit 77b380c0b5

@ -668,7 +668,6 @@ int APP_CC
g_tcp_connect(int sck, const char *address, const char *port)
{
int res = 0;
char errorMsg[256];
struct addrinfo p;
struct addrinfo *h = (struct addrinfo *)NULL;
struct addrinfo *rp = (struct addrinfo *)NULL;
@ -696,9 +695,8 @@ g_tcp_connect(int sck, const char *address, const char *port)
}
if (res != 0)
{
snprintf(errorMsg, 255, "g_tcp_connect: getaddrinfo() failed: %s",
gai_strerror(res));
log_message(LOG_LEVEL_ERROR, errorMsg);
log_message(LOG_LEVEL_ERROR, "g_tcp_connect: getaddrinfo() failed: %s",
gai_strerror(res));
}
if (res > -1)
{
@ -988,7 +986,7 @@ g_tcp_accept(int sck)
{
snprintf(ipAddr, 255, "A connection received from: %s port %d",
inet_ntoa(s.sin_addr), ntohs(s.sin_port));
log_message(LOG_LEVEL_INFO,ipAddr);
log_message(LOG_LEVEL_INFO, "%s", ipAddr);
}
return ret ;
}
@ -1013,7 +1011,7 @@ g_sck_accept(int sck, char *addr, int addr_bytes, char *port, int port_bytes)
{
g_snprintf(ipAddr, 255, "A connection received from: %s port %d",
inet_ntoa(s.sin_addr), ntohs(s.sin_port));
log_message(LOG_LEVEL_INFO,ipAddr);
log_message(LOG_LEVEL_INFO, "%s", ipAddr);
if (s.sin_family == AF_INET)
{
g_snprintf(addr, addr_bytes, "%s", inet_ntoa(s.sin_addr));

@ -230,7 +230,7 @@ lxrdp_event(struct mod *mod, int msg, long param1, long param2,
break;
case 17: /* Synchronize */
LLOGLN(11, ("Synchronized event handled : %d", param1));
LLOGLN(11, ("Synchronized event handled : %ld", param1));
/* In some situations the Synchronize event come to early.
Therefore we store this information and use it when we
receive the first keyboard event
@ -246,7 +246,7 @@ lxrdp_event(struct mod *mod, int msg, long param1, long param2,
break;
case 100: /* mouse move */
LLOGLN(12, ("mouse move %d %d", param1, param2));
LLOGLN(12, ("mouse move %ld %ld", param1, param2));
x = param1;
y = param2;
flags = PTR_FLAGS_MOVE;
@ -254,7 +254,7 @@ lxrdp_event(struct mod *mod, int msg, long param1, long param2,
break;
case 101: /* left button up */
LLOGLN(12, ("left button up %d %d", param1, param2));
LLOGLN(12, ("left button up %ld %ld", param1, param2));
x = param1;
y = param2;
flags = PTR_FLAGS_BUTTON1;
@ -262,7 +262,7 @@ lxrdp_event(struct mod *mod, int msg, long param1, long param2,
break;
case 102: /* left button down */
LLOGLN(12, ("left button down %d %d", param1, param2));
LLOGLN(12, ("left button down %ld %ld", param1, param2));
x = param1;
y = param2;
flags = PTR_FLAGS_BUTTON1 | PTR_FLAGS_DOWN;
@ -270,7 +270,7 @@ lxrdp_event(struct mod *mod, int msg, long param1, long param2,
break;
case 103: /* right button up */
LLOGLN(12, ("right button up %d %d", param1, param2));
LLOGLN(12, ("right button up %ld %ld", param1, param2));
x = param1;
y = param2;
flags = PTR_FLAGS_BUTTON2;
@ -278,7 +278,7 @@ lxrdp_event(struct mod *mod, int msg, long param1, long param2,
break;
case 104: /* right button down */
LLOGLN(12, ("right button down %d %d", param1, param2));
LLOGLN(12, ("right button down %ld %ld", param1, param2));
x = param1;
y = param2;
flags = PTR_FLAGS_BUTTON2 | PTR_FLAGS_DOWN;
@ -286,7 +286,7 @@ lxrdp_event(struct mod *mod, int msg, long param1, long param2,
break;
case 105: /* middle button up */
LLOGLN(12, ("middle button up %d %d", param1, param2));
LLOGLN(12, ("middle button up %ld %ld", param1, param2));
x = param1;
y = param2;
flags = PTR_FLAGS_BUTTON3;
@ -294,7 +294,7 @@ lxrdp_event(struct mod *mod, int msg, long param1, long param2,
break;
case 106: /* middle button down */
LLOGLN(12, ("middle button down %d %d", param1, param2));
LLOGLN(12, ("middle button down %ld %ld", param1, param2));
x = param1;
y = param2;
flags = PTR_FLAGS_BUTTON3 | PTR_FLAGS_DOWN;

@ -734,8 +734,7 @@ process_message(void)
rv = process_message_channel_data_response(s);
break;
default:
LOGM((LOG_LEVEL_ERROR, "process_message: error in process_message ",
"unknown msg %d", id));
LOGM((LOG_LEVEL_ERROR, "process_message: unknown msg %d", id));
break;
}

@ -1920,7 +1920,8 @@ clipboard_event_selection_notify(XEvent *xevent)
for (index = 0; index < n_items; index++)
{
atom = atoms[index];
LOGM((LOG_LEVEL_DEBUG, "clipboard_event_selection_notify: %d %s %d",
LOGM((LOG_LEVEL_DEBUG,
"clipboard_event_selection_notify: 0x%lx %s 0x%lx",
atom, get_atom_text(atom), XA_STRING));
log_debug("clipboard_event_selection_notify: 0x%lx %s",
atom, get_atom_text(atom));

@ -963,7 +963,7 @@ session_get_bypid(int pid)
if (0 == dummy)
{
log_message(LOG_LEVEL_ERROR, "internal error", pid);
log_message(LOG_LEVEL_ERROR, "session_get_bypid: out of memory");
return 0;
}

@ -233,7 +233,7 @@ lib_process_channel_data(struct vnc *v, int chanid, int flags, int size,
}
else
{
log_message(LOG_LEVEL_DEBUG, "lib_process_channel_data: unknown chanid:",
log_message(LOG_LEVEL_DEBUG, "lib_process_channel_data: unknown chanid: "
"%d :(v->clip_chanid) %d", chanid, v->clip_chanid);
}

@ -273,7 +273,6 @@ xrdp_wm_parse_domain_information(char *originalDomainInfo, int comboMax,
int pos;
int comboxindex;
char index[2];
char debugstr[256];
/* If the first char in the domain name is '_' we use the domain
name as IP*/
@ -300,11 +299,9 @@ xrdp_wm_parse_domain_information(char *originalDomainInfo, int comboMax,
/* we just accept values 0-9 (one figure) */
g_strncpy(index, &originalDomainInfo[pos + 3], 1);
comboxindex = g_htoi(index);
g_snprintf(debugstr, 255, "Value of index (as char): %s "
"(converted) : %d (max) : %d", index, comboxindex,
comboMax - 1);
debugstr[255] = 0;
log_message(LOG_LEVEL_DEBUG, debugstr);
log_message(LOG_LEVEL_DEBUG,
"index value as string: %s, as int: %d, max: %d",
index, comboxindex, comboMax - 1);
/* limit to max number of items in combo box */
if ((comboxindex > 0) && (comboxindex < comboMax))
{

@ -375,7 +375,7 @@ xrdp_mm_setup_mod1(struct xrdp_mm *self)
g_snprintf(text, 255, "error finding proc mod_init in %s, not a valid "
"xrdp backend", lib);
xrdp_wm_log_msg(self->wm, text);
log_message(LOG_LEVEL_ERROR,text);
log_message(LOG_LEVEL_ERROR, "%s", text);
}
self->mod_init = (struct xrdp_mod * ( *)(void))func;
@ -391,7 +391,7 @@ xrdp_mm_setup_mod1(struct xrdp_mm *self)
g_snprintf(text, 255, "error finding proc mod_exit in %s, not a valid "
"xrdp backend", lib);
xrdp_wm_log_msg(self->wm, text);
log_message(LOG_LEVEL_ERROR,text);
log_message(LOG_LEVEL_ERROR, "%s", text);
}
self->mod_exit = (int ( *)(struct xrdp_mod *))func;
@ -416,7 +416,7 @@ xrdp_mm_setup_mod1(struct xrdp_mm *self)
g_snprintf(text, 255, "error loading %s specified in xrdp.ini, please "
"add a valid entry like lib=libxrdp-vnc.so or similar", lib);
xrdp_wm_log_msg(self->wm, text);
log_message(LOG_LEVEL_ERROR,text);
log_message(LOG_LEVEL_ERROR, "%s", text);
return 1;
}
@ -1489,7 +1489,7 @@ access_control(char *username, char *password, char *srv)
else
{
log_message(LOG_LEVEL_ERROR, "Corrupt reply size or "
"version from sesman: %d", size);
"version from sesman: %ld", size);
}
}
else
@ -1909,7 +1909,7 @@ xrdp_mm_connect(struct xrdp_mm *self)
getPAMError(reply, pam_error, 127));
xrdp_wm_log_msg(self->wm, replytxt);
log_message(LOG_LEVEL_INFO, replytxt);
log_message(LOG_LEVEL_INFO, "%s", replytxt);
additionalError = getPAMAdditionalErrorInfo(reply, self);
if (additionalError)
{
@ -1970,7 +1970,7 @@ xrdp_mm_connect(struct xrdp_mm *self)
g_snprintf(errstr, 255, "Failure to connect to sesman: %s port: %s",
ip, port);
xrdp_wm_log_msg(self->wm, errstr);
log_message(LOG_LEVEL_ERROR,errstr);
log_message(LOG_LEVEL_ERROR, "%s", errstr);
trans_delete(self->sesman_trans);
self->sesman_trans = 0;
self->sesman_trans_up = 0;
@ -1990,7 +1990,7 @@ xrdp_mm_connect(struct xrdp_mm *self)
{
/* connect error */
g_snprintf(errstr, 255, "Failure to connect to: %s", ip);
log_message(LOG_LEVEL_ERROR,errstr);
log_message(LOG_LEVEL_ERROR, "%s", errstr);
xrdp_wm_log_msg(self->wm, errstr);
rv = 1; /* failure */
}

@ -45,7 +45,7 @@ xrdp_wm_create(struct xrdp_process *owner,
pid = g_getpid();
g_snprintf(event_name, 255, "xrdp_%8.8x_wm_login_mode_event_%8.8x",
pid, owner->session_id);
log_message(LOG_LEVEL_DEBUG,event_name);
log_message(LOG_LEVEL_DEBUG, "%s", event_name);
self->login_mode_event = g_create_wait_obj(event_name);
self->painter = xrdp_painter_create(self, self->session);
self->cache = xrdp_cache_create(self, self->session, self->client_info);

Loading…
Cancel
Save