Commit 7a173aed authored by Federico Vaga's avatar Federico Vaga

fald-trg-cfg: handle fgets() error

Signed-off-by: Federico Vaga's avatarFederico Vaga <federico.vaga@cern.ch>
parent 4f2fa84f
......@@ -28,6 +28,10 @@ int main()
memset(msg, 0, 512);
fprintf(stdout, "Change trig config using standard args: -a -b -c -n -e\n >>>: ");
ptr = fgets(msg, sizeof(msg), stdin);
if (!ptr) {
fprintf(stderr, "Error while reading options\n");
break;
}
/* removing newline at the end */
if (msg[strlen(msg)-1] == '\n')
msg[strlen(msg)-1] = '\0';
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment