Fix asprintf and scanf ignoring return value
[ust.git] / tests / hello / hello.c
index 86c5c71cacc9f4f27ee8308db3bffde85528db0e..7eecf69e83f0bbaf23949a71e191806bf884687a 100644 (file)
@@ -26,8 +26,8 @@
 
 #include <ust/marker.h>
 #include "usterr.h"
-#include "tp.h"
 #include "tracer.h"
+#include "tp.h"
 
 void inthandler(int sig)
 {
@@ -77,13 +77,15 @@ int main()
                usleep(100000);
        }
 
-       scanf("%*s");
+       if (scanf("%*s") == EOF)
+               PERROR("scanf failed");
 
        ltt_trace_stop("auto");
        ltt_trace_destroy("auto", 0);
 
        DBG("TRACE STOPPED");
-       scanf("%*s");
+       if (scanf("%*s") == EOF)
+               PERROR("scanf failed");
 
        return 0;
 }
This page took 0.029872 seconds and 4 git commands to generate.