[recipes] Fix an off-by-one in timer parsing
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [recipes] Fix an off-by-one in timer parsing
- Date: Sat, 18 Feb 2017 01:41:11 +0000 (UTC)
commit 07f38178be0d7624210cd6be6d9782aa36514877
Author: Matthias Clasen <mclasen redhat com>
Date: Fri Feb 17 20:08:36 2017 -0500
Fix an off-by-one in timer parsing
We were loosing the least significant digit of the seconds field.
src/gr-recipe-formatter.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/src/gr-recipe-formatter.c b/src/gr-recipe-formatter.c
index d770b88..e4884bc 100644
--- a/src/gr-recipe-formatter.c
+++ b/src/gr-recipe-formatter.c
@@ -188,7 +188,7 @@ gr_recipe_parse_instructions (const char *instructions)
char *tmp;
q = strstr (p, "]");
- s = strndup (p + strlen ("[timer:"), q - (p + strlen ("[timer:")) - 1);
+ s = strndup (p + strlen ("[timer:"), q - (p + strlen ("[timer:")));
strv = g_strsplit (s, ":", -1);
if (g_strv_length (strv) == 2) {
timer = G_TIME_SPAN_MINUTE * atoi (strv[0]) +
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]