From 8b75a185a2641cb76df3898bd40ae89b5b3d7318 Mon Sep 17 00:00:00 2001 From: 3011357 <3011357@stud.hs-mannheim.de> Date: Sun, 27 Oct 2024 00:44:48 +0200 Subject: [PATCH] Added reset of ts.minutes inside addMinutesToTimestamp function --- Testat-Planer.zig | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Testat-Planer.zig b/Testat-Planer.zig index a05f54a..0e4864e 100644 --- a/Testat-Planer.zig +++ b/Testat-Planer.zig @@ -1,5 +1,5 @@ const std = @import("std"); -const writer = std.io.getStdOut().writer(); //rausnehmen +const writer = std.io.getStdOut().writer(); const Timestamp = struct { @@ -55,10 +55,11 @@ pub fn addMinutesToTimestamp(ts: *Timestamp, min: u16) !void{ if ((addMinutes + ts.minutes) >= 60){ addMinutes = (addMinutes + ts.minutes)%60; addHours += 1; + ts.minutes = 0; } ts.hours += addHours; - ts.hours += addMinutes; + ts.minutes += addMinutes; }