summaryrefslogtreecommitdiff
path: root/app/xsm/remote.c
diff options
context:
space:
mode:
Diffstat (limited to 'app/xsm/remote.c')
-rw-r--r--app/xsm/remote.c25
1 files changed, 11 insertions, 14 deletions
diff --git a/app/xsm/remote.c b/app/xsm/remote.c
index f161f96f2..76cde303c 100644
--- a/app/xsm/remote.c
+++ b/app/xsm/remote.c
@@ -32,13 +32,8 @@ in this Software without prior written authorization from The Open Group.
#include "xsm.h"
#include "log.h"
-#include <X11/ICE/ICEutil.h>
-
static char *format_rstart_env(char *str);
-extern IceAuthDataEntry *authDataEntries;
-extern int numTransports;
-
void
remote_start(char *restart_protocol, char *restart_machine, char *program,
@@ -70,8 +65,9 @@ remote_start(char *restart_protocol, char *restart_machine, char *program,
if (pipe (pipefd) < 0)
{
- sprintf (msg, "%s: pipe() error during remote start of %s",
- Argv[0], program);
+ snprintf (msg, sizeof(msg),
+ "%s: pipe() error during remote start of %s",
+ Argv[0], program);
add_log_text (msg);
perror (msg);
}
@@ -81,8 +77,9 @@ remote_start(char *restart_protocol, char *restart_machine, char *program,
{
case -1:
- sprintf (msg, "%s: fork() error during remote start of %s",
- Argv[0], program);
+ snprintf (msg, sizeof(msg),
+ "%s: fork() error during remote start of %s",
+ Argv[0], program);
add_log_text (msg);
perror (msg);
break;
@@ -96,9 +93,9 @@ remote_start(char *restart_protocol, char *restart_machine, char *program,
execlp (RSHCMD, restart_machine, "rstartd", (char *) 0);
- sprintf (msg,
- "%s: execlp() of rstartd failed for remote start of %s",
- Argv[0], program);
+ snprintf (msg, sizeof(msg),
+ "%s: execlp() of rstartd failed for remote start of %s",
+ Argv[0], program);
perror (msg);
/*
* TODO : We would like to send this log information to the
@@ -228,8 +225,8 @@ format_rstart_env(char *str)
{
if (!isgraph (*temp) || *temp == '\\')
{
- char octal[3];
- sprintf (octal, "%o", *temp);
+ char octal[4];
+ snprintf (octal, sizeof(octal), "%o", *temp);
*(ptr++) = '\\';
for (i = 0; i < (3 - (int) strlen (octal)); i++)
*(ptr++) = '0';