summaryrefslogtreecommitdiff
path: root/app/xman/handler.c
diff options
context:
space:
mode:
authorMatthieu Herrb <matthieu@cvs.openbsd.org>2011-08-28 13:15:53 +0000
committerMatthieu Herrb <matthieu@cvs.openbsd.org>2011-08-28 13:15:53 +0000
commit71eb4812b00dd0d98a05887a21df58717941fc76 (patch)
tree43f697e092a3a5b599869d91f40976ca3e3526b0 /app/xman/handler.c
parente03da26e2f5829d91468bd99745bf24139cd3e2b (diff)
Update to xman 1.1.2
Diffstat (limited to 'app/xman/handler.c')
-rw-r--r--app/xman/handler.c30
1 files changed, 14 insertions, 16 deletions
diff --git a/app/xman/handler.c b/app/xman/handler.c
index cf2d83a74..4fe291f04 100644
--- a/app/xman/handler.c
+++ b/app/xman/handler.c
@@ -330,30 +330,30 @@ SaveFormattedPage(Widget w, XEvent * event, String * params, Cardinal * num_para
if (!man_globals->compress)
#endif
- sprintf(cmdbuf, "%s %s %s", COPY, man_globals->tempfile,
- man_globals->save_file);
+ snprintf(cmdbuf, sizeof(cmdbuf), "%s %s %s", COPY,
+ man_globals->tempfile, man_globals->save_file);
#ifndef NO_COMPRESS
else
if (man_globals->gzip)
- sprintf(cmdbuf, "%s < %s > %s", GZIP_COMPRESS, man_globals->tempfile,
- man_globals->save_file);
+ snprintf(cmdbuf, sizeof(cmdbuf), "%s < %s > %s", GZIP_COMPRESS,
+ man_globals->tempfile, man_globals->save_file);
else
- sprintf(cmdbuf, "%s < %s > %s", COMPRESS, man_globals->tempfile,
- man_globals->save_file);
+ snprintf(cmdbuf, sizeof(cmdbuf), "%s < %s > %s", COMPRESS,
+ man_globals->tempfile, man_globals->save_file);
#endif
if(! system(cmdbuf)) {
/* make sure the formatted man page is fully accessible by the world */
if (chmod(man_globals->save_file, CHMOD_MODE) != 0) {
- sprintf(error_buf,
+ snprintf(error_buf, sizeof(error_buf),
"Couldn't set permissions on formatted man page '%s'.\n",
man_globals->save_file);
PopupWarning( man_globals, error_buf);
}
} else {
- sprintf(error_buf, "Error while executing the command '%s'.\n",
- cmdbuf);
+ snprintf(error_buf, sizeof(error_buf),
+ "Error while executing the command '%s'.\n", cmdbuf);
PopupWarning( man_globals, error_buf);
}
break;
@@ -361,9 +361,8 @@ SaveFormattedPage(Widget w, XEvent * event, String * params, Cardinal * num_para
case 'c':
break;
default:
- sprintf(error_buf,"%s %s", "Xman - SaveFormattedPagee:",
- "Unknown argument must be either 'Save' or 'Cancel'.");
- PopupWarning(man_globals, error_buf);
+ PopupWarning(man_globals, "Xman - SaveFormattedPage: "
+ "Unknown argument must be either 'Save' or 'Cancel'.");
return;
}
@@ -392,7 +391,6 @@ void
GotoPage(Widget w, XEvent * event, String * params, Cardinal * num_params)
{
ManpageGlobals * man_globals;
- char error_buf[BUFSIZ];
Arg arglist[1];
Boolean sensitive;
@@ -431,9 +429,9 @@ GotoPage(Widget w, XEvent * event, String * params, Cardinal * num_params)
man_globals->dir_shown = TRUE;
break;
default:
- sprintf(error_buf,"%s %s", "Xman - GotoPage: Unknown argument must be",
- "either Manpage or Directory.");
- XtAppWarning(XtWidgetToApplicationContext(w), error_buf);
+ XtAppWarning(XtWidgetToApplicationContext(w),
+ "Xman - GotoPage: Unknown argument must be "
+ "either Manpage or Directory.");
return;
}
}