summaryrefslogtreecommitdiff
path: root/gui/timer.c
diff options
context:
space:
mode:
authorWerner Almesberger <werner@almesberger.net>2016-08-30 06:49:49 -0300
committerWerner Almesberger <werner@almesberger.net>2016-08-30 06:49:49 -0300
commit9a0fe02922549d804ba0e4a9c8535ce25f7930d9 (patch)
tree44caf72d27bd070597a7a846fbb9f44f40a92568 /gui/timer.c
parentfe2d12a590aa637881c7f3fc53d3cca9e246c195 (diff)
downloadeeshow-9a0fe02922549d804ba0e4a9c8535ce25f7930d9.tar.gz
eeshow-9a0fe02922549d804ba0e4a9c8535ce25f7930d9.tar.bz2
eeshow-9a0fe02922549d804ba0e4a9c8535ce25f7930d9.zip
misc/util.h (alloc_printf): error-checking vasprintf wrapper; use it
Diffstat (limited to 'gui/timer.c')
-rw-r--r--gui/timer.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/gui/timer.c b/gui/timer.c
index 6d6cdd6..37304d6 100644
--- a/gui/timer.c
+++ b/gui/timer.c
@@ -10,7 +10,6 @@
* (at your option) any later version.
*/
-#define _GNU_SOURCE /* for asprintf */
#include <stdbool.h>
#include <stdio.h>
#include <sys/time.h>
@@ -64,9 +63,8 @@ void timer_show(cairo_t *cr)
now.tv_usec += 1000000;
}
-
- if (asprintf(&s , "%u.%03d",
- (unsigned) now.tv_sec, (int) now.tv_usec / 1000)) {}
+ alloc_printf(&s , "%u.%03d",
+ (unsigned) now.tv_sec, (int) now.tv_usec / 1000);
timer_show_cairo(cr, s);
}