From 50dd7507c103e01c23f5910041aaeb48067abfdb Mon Sep 17 00:00:00 2001 From: Thomas Voss Date: Wed, 14 Feb 2024 17:08:30 +0100 Subject: Check return value of clock_gettime() --- src/ahoy/emulator.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/ahoy/emulator.c b/src/ahoy/emulator.c index 100d70c..1298ea0 100644 --- a/src/ahoy/emulator.c +++ b/src/ahoy/emulator.c @@ -84,7 +84,8 @@ emulate(struct u8view prog) PC = MEM_RESERVED; memcpy(mem + PC, prog.p, prog.len); - clock_gettime(CLOCK_REALTIME, &tp); + if (clock_gettime(CLOCK_REALTIME, &tp) == -1) + die("clock_gettime"); srand(tp.tv_sec ^ tp.tv_nsec); for (;; PC += 2) { -- cgit v1.2.3