From 00606fecc2c25e284609bd753f81c059dc46ff46 Mon Sep 17 00:00:00 2001 From: Holger Vogt Date: Sun, 5 Jan 2020 14:34:35 +0100 Subject: [PATCH] deprecated gets() -> fgets() --- src/xspice/ipc/ipcstdio.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/xspice/ipc/ipcstdio.c b/src/xspice/ipc/ipcstdio.c index 15ef467b1..229fff3ba 100644 --- a/src/xspice/ipc/ipcstdio.c +++ b/src/xspice/ipc/ipcstdio.c @@ -45,7 +45,10 @@ Ipc_Status_t ipc_transport_get_line ( NG_IGNORE(wait); printf ("GET_LINE\n"); - gets (str); + fgets (str, 512, stdin); + char *tmp = strchr(str, '\n'); + if (tmp) + *tmp = '\0'; *len = (int) strlen (str); return IPC_STATUS_OK; }