From 2877694d0ae468357d5226ae6563d2291d07e9b3 Mon Sep 17 00:00:00 2001 From: Sebastian Ramacher Date: Tue, 27 Nov 2018 23:45:54 +0100 Subject: [PATCH] Avoid second call to g_ascii_strtoll --- zathura/adjustment.c | 2 +- zathura/synctex.c | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/zathura/adjustment.c b/zathura/adjustment.c index b983571..fcd4d15 100644 --- a/zathura/adjustment.c +++ b/zathura/adjustment.c @@ -2,8 +2,8 @@ #include "adjustment.h" #include "utils.h" -#include +#include double page_calc_height_width(zathura_document_t* document, double height, diff --git a/zathura/synctex.c b/zathura/synctex.c index 0377f13..6de8567 100644 --- a/zathura/synctex.c +++ b/zathura/synctex.c @@ -254,8 +254,10 @@ synctex_parse_input(const char* synctex, char** input_file, int* line, return false; } - *line = MIN(INT_MAX, g_ascii_strtoll(split_fwd[0], NULL, 10)); - *column = MIN(INT_MAX, g_ascii_strtoll(split_fwd[1], NULL, 10)); + gint64 tmp = g_ascii_strtoll(split_fwd[0], NULL, 10); + *line = MIN(INT_MAX, tmp); + tmp = g_ascii_strtoll(split_fwd[1], NULL, 10); + *column = MIN(INT_MAX, tmp); /* SyncTeX starts indexing at 1, but we use 0 */ if (*line > 0) { --*line;