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) g_tcp_connect(int sck, const char *address, const char *port)
{ {
int res = 0; int res = 0;
char errorMsg[256];
struct addrinfo p; struct addrinfo p;
struct addrinfo *h = (struct addrinfo *)NULL; struct addrinfo *h = (struct addrinfo *)NULL;
struct addrinfo *rp = (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) if (res != 0)
{ {
snprintf(errorMsg, 255, "g_tcp_connect: getaddrinfo() failed: %s", log_message(LOG_LEVEL_ERROR, "g_tcp_connect: getaddrinfo() failed: %s",
gai_strerror(res)); gai_strerror(res));
log_message(LOG_LEVEL_ERROR, errorMsg);
} }
if (res > -1) if (res > -1)
{ {
@ -988,7 +986,7 @@ g_tcp_accept(int sck)
{ {
snprintf(ipAddr, 255, "A connection received from: %s port %d", snprintf(ipAddr, 255, "A connection received from: %s port %d",
inet_ntoa(s.sin_addr), ntohs(s.sin_port)); inet_ntoa(s.sin_addr), ntohs(s.sin_port));
log_message(LOG_LEVEL_INFO,ipAddr); log_message(LOG_LEVEL_INFO, "%s", ipAddr);
} }
return ret ; 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", g_snprintf(ipAddr, 255, "A connection received from: %s port %d",
inet_ntoa(s.sin_addr), ntohs(s.sin_port)); 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) if (s.sin_family == AF_INET)
{ {
g_snprintf(addr, addr_bytes, "%s", inet_ntoa(s.sin_addr)); 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; break;
case 17: /* Synchronize */ 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. /* In some situations the Synchronize event come to early.
Therefore we store this information and use it when we Therefore we store this information and use it when we
receive the first keyboard event receive the first keyboard event
@ -246,7 +246,7 @@ lxrdp_event(struct mod *mod, int msg, long param1, long param2,
break; break;
case 100: /* mouse move */ case 100: /* mouse move */
LLOGLN(12, ("mouse move %d %d", param1, param2)); LLOGLN(12, ("mouse move %ld %ld", param1, param2));
x = param1; x = param1;
y = param2; y = param2;
flags = PTR_FLAGS_MOVE; flags = PTR_FLAGS_MOVE;
@ -254,7 +254,7 @@ lxrdp_event(struct mod *mod, int msg, long param1, long param2,
break; break;
case 101: /* left button up */ 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; x = param1;
y = param2; y = param2;
flags = PTR_FLAGS_BUTTON1; flags = PTR_FLAGS_BUTTON1;
@ -262,7 +262,7 @@ lxrdp_event(struct mod *mod, int msg, long param1, long param2,
break; break;
case 102: /* left button down */ 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; x = param1;
y = param2; y = param2;
flags = PTR_FLAGS_BUTTON1 | PTR_FLAGS_DOWN; flags = PTR_FLAGS_BUTTON1 | PTR_FLAGS_DOWN;
@ -270,7 +270,7 @@ lxrdp_event(struct mod *mod, int msg, long param1, long param2,
break; break;
case 103: /* right button up */ 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; x = param1;
y = param2; y = param2;
flags = PTR_FLAGS_BUTTON2; flags = PTR_FLAGS_BUTTON2;
@ -278,7 +278,7 @@ lxrdp_event(struct mod *mod, int msg, long param1, long param2,
break; break;
case 104: /* right button down */ 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; x = param1;
y = param2; y = param2;
flags = PTR_FLAGS_BUTTON2 | PTR_FLAGS_DOWN; flags = PTR_FLAGS_BUTTON2 | PTR_FLAGS_DOWN;
@ -286,7 +286,7 @@ lxrdp_event(struct mod *mod, int msg, long param1, long param2,
break; break;
case 105: /* middle button up */ 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; x = param1;
y = param2; y = param2;
flags = PTR_FLAGS_BUTTON3; flags = PTR_FLAGS_BUTTON3;
@ -294,7 +294,7 @@ lxrdp_event(struct mod *mod, int msg, long param1, long param2,
break; break;
case 106: /* middle button down */ 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; x = param1;
y = param2; y = param2;
flags = PTR_FLAGS_BUTTON3 | PTR_FLAGS_DOWN; flags = PTR_FLAGS_BUTTON3 | PTR_FLAGS_DOWN;

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

@ -1920,7 +1920,8 @@ clipboard_event_selection_notify(XEvent *xevent)
for (index = 0; index < n_items; index++) for (index = 0; index < n_items; index++)
{ {
atom = atoms[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)); atom, get_atom_text(atom), XA_STRING));
log_debug("clipboard_event_selection_notify: 0x%lx %s", log_debug("clipboard_event_selection_notify: 0x%lx %s",
atom, get_atom_text(atom)); atom, get_atom_text(atom));

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

@ -233,7 +233,7 @@ lib_process_channel_data(struct vnc *v, int chanid, int flags, int size,
} }
else 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); "%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 pos;
int comboxindex; int comboxindex;
char index[2]; char index[2];
char debugstr[256];
/* If the first char in the domain name is '_' we use the domain /* If the first char in the domain name is '_' we use the domain
name as IP*/ name as IP*/
@ -300,11 +299,9 @@ xrdp_wm_parse_domain_information(char *originalDomainInfo, int comboMax,
/* we just accept values 0-9 (one figure) */ /* we just accept values 0-9 (one figure) */
g_strncpy(index, &originalDomainInfo[pos + 3], 1); g_strncpy(index, &originalDomainInfo[pos + 3], 1);
comboxindex = g_htoi(index); comboxindex = g_htoi(index);
g_snprintf(debugstr, 255, "Value of index (as char): %s " log_message(LOG_LEVEL_DEBUG,
"(converted) : %d (max) : %d", index, comboxindex, "index value as string: %s, as int: %d, max: %d",
comboMax - 1); index, comboxindex, comboMax - 1);
debugstr[255] = 0;
log_message(LOG_LEVEL_DEBUG, debugstr);
/* limit to max number of items in combo box */ /* limit to max number of items in combo box */
if ((comboxindex > 0) && (comboxindex < comboMax)) 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 " g_snprintf(text, 255, "error finding proc mod_init in %s, not a valid "
"xrdp backend", lib); "xrdp backend", lib);
xrdp_wm_log_msg(self->wm, text); 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; 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 " g_snprintf(text, 255, "error finding proc mod_exit in %s, not a valid "
"xrdp backend", lib); "xrdp backend", lib);
xrdp_wm_log_msg(self->wm, text); 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; 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 " g_snprintf(text, 255, "error loading %s specified in xrdp.ini, please "
"add a valid entry like lib=libxrdp-vnc.so or similar", lib); "add a valid entry like lib=libxrdp-vnc.so or similar", lib);
xrdp_wm_log_msg(self->wm, text); xrdp_wm_log_msg(self->wm, text);
log_message(LOG_LEVEL_ERROR,text); log_message(LOG_LEVEL_ERROR, "%s", text);
return 1; return 1;
} }
@ -1489,7 +1489,7 @@ access_control(char *username, char *password, char *srv)
else else
{ {
log_message(LOG_LEVEL_ERROR, "Corrupt reply size or " log_message(LOG_LEVEL_ERROR, "Corrupt reply size or "
"version from sesman: %d", size); "version from sesman: %ld", size);
} }
} }
else else
@ -1909,7 +1909,7 @@ xrdp_mm_connect(struct xrdp_mm *self)
getPAMError(reply, pam_error, 127)); getPAMError(reply, pam_error, 127));
xrdp_wm_log_msg(self->wm, replytxt); xrdp_wm_log_msg(self->wm, replytxt);
log_message(LOG_LEVEL_INFO, replytxt); log_message(LOG_LEVEL_INFO, "%s", replytxt);
additionalError = getPAMAdditionalErrorInfo(reply, self); additionalError = getPAMAdditionalErrorInfo(reply, self);
if (additionalError) 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", g_snprintf(errstr, 255, "Failure to connect to sesman: %s port: %s",
ip, port); ip, port);
xrdp_wm_log_msg(self->wm, errstr); 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); trans_delete(self->sesman_trans);
self->sesman_trans = 0; self->sesman_trans = 0;
self->sesman_trans_up = 0; self->sesman_trans_up = 0;
@ -1990,7 +1990,7 @@ xrdp_mm_connect(struct xrdp_mm *self)
{ {
/* connect error */ /* connect error */
g_snprintf(errstr, 255, "Failure to connect to: %s", ip); 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); xrdp_wm_log_msg(self->wm, errstr);
rv = 1; /* failure */ rv = 1; /* failure */
} }

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

Loading…
Cancel
Save