summaryrefslogtreecommitdiff
path: root/remote.c
diff options
context:
space:
mode:
Diffstat (limited to 'remote.c')
-rw-r--r--remote.c20
1 files changed, 11 insertions, 9 deletions
diff --git a/remote.c b/remote.c
index f161f96..52df33e 100644
--- a/remote.c
+++ b/remote.c
@@ -70,8 +70,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 +82,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 +98,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 +230,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';