From: David Wasley Date: Wed, 18 Feb 1981 11:29:10 +0000 (-0800) Subject: added null termination to command. DLW X-Git-Tag: BSD-4_1_snap-Snapshot-Development~2250 X-Git-Url: https://git.subgeniuskitty.com/unix-history/.git/commitdiff_plain/a05d0553990114c89e4c12b26205d920947e2eb1 added null termination to command. DLW SCCS-vsn: usr.bin/f77/libU77/system_.c 1.3 --- diff --git a/usr/src/usr.bin/f77/libU77/system_.c b/usr/src/usr.bin/f77/libU77/system_.c index 06008b0db0..3c8be54d5c 100644 --- a/usr/src/usr.bin/f77/libU77/system_.c +++ b/usr/src/usr.bin/f77/libU77/system_.c @@ -1,5 +1,5 @@ /* -char id_system[] = "@(#)system_.c 1.2"; +char id_system[] = "@(#)system_.c 1.3"; * * execute a unix command * @@ -11,14 +11,19 @@ char id_system[] = "@(#)system_.c 1.2"; */ #include "../libI77/fiodefs.h" +#include "../libI77/f_errno.h" long system_(s, n) char *s; long n; { + char buf[256]; int i; + if (n >= sizeof buf) + return(-(long)(errno=F_ERARG)); for (i = 0; i < MXUNIT; flush(i++)) ; - return((long)system(s)); + g_char(s, n, buf); + return((long)system(buf)); }