Skip to content

Commit 01f63dc

Browse files
authored
ximgview: Fix Unchecked return value in main.c (#5204)
1 parent 99ed5dd commit 01f63dc

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

visualization/ximgview/main.c

+6-2
Original file line numberDiff line numberDiff line change
@@ -120,11 +120,15 @@ static void redraw(void)
120120
{
121121
struct timeval tv0, tv1;
122122

123-
gettimeofday(&tv0, NULL);
123+
if (gettimeofday(&tv0, NULL) != 0) {
124+
G_fatal_error(_("gettimeofday failed"));
125+
}
124126

125127
draw();
126128

127-
gettimeofday(&tv1, NULL);
129+
if (gettimeofday(&tv1, NULL) != 0) {
130+
G_fatal_error(_("gettimeofday failed"));
131+
}
128132
last = (tv1.tv_sec - tv0.tv_sec) * 1000000L + (tv1.tv_usec - tv0.tv_usec);
129133
}
130134

0 commit comments

Comments
 (0)