openbsd-ports/cad/spice/patches/patch-src_bin_sconvert_c
pvalchev cdd1b7dcc9 Rename patches to make update-patches useful, delete the .orig files after
applying the distribution internal patches not to confuse update-patches.
2001-08-02 23:54:56 +00:00

64 lines
1.5 KiB
Plaintext

$OpenBSD: patch-src_bin_sconvert_c,v 1.1 2001/08/02 23:54:56 pvalchev Exp $
--- src/bin/sconvert.c.orig Mon Sep 14 19:30:41 1992
+++ src/bin/sconvert.c Thu Aug 2 17:32:11 2001
@@ -42,6 +42,7 @@ main(ac, av)
{
char *sf, *af;
char buf[BSIZE_SP];
+ char *p;
char t, f;
struct plot *pl;
int i;
@@ -80,19 +81,47 @@ main(ac, av)
case 1: printf("Input file: ");
(void) fflush(stdout);
- (void) gets(buf);
+ if ( fgets(buf, sizeof buf, stdin) == 0 ) {
+ buf[ 0 ] = 0;
+ } else {
+ p = strchr( buf, '\n' );
+ if ( p ) {
+ *p = 0;
+ }
+ }
sf = copy(buf);
printf("Input type: ");
(void) fflush(stdout);
- (void) gets(buf);
+ if ( fgets(buf, sizeof buf, stdin) == 0 ) {
+ buf[ 0 ] = 0;
+ } else {
+ p = strchr( buf, '\n' );
+ if ( p ) {
+ *p = 0;
+ }
+ }
f = buf[0];
printf("Output file: ");
(void) fflush(stdout);
- (void) gets(buf);
+ if ( fgets(buf, sizeof buf, stdin) == 0 ) {
+ buf[ 0 ] = 0;
+ } else {
+ p = strchr( buf, '\n' );
+ if ( p ) {
+ *p = 0;
+ }
+ }
af = copy(buf);
printf("Output type: ");
(void) fflush(stdout);
- (void) gets(buf);
+ if ( fgets(buf, sizeof buf, stdin) == 0 ) {
+ buf[ 0 ] = 0;
+ } else {
+ p = strchr( buf, '\n' );
+ if ( p ) {
+ *p = 0;
+ }
+ }
t = buf[0];
break;
default: