From 27c0fd1622b6b5745c1178bffbb7d44225b0d60e Mon Sep 17 00:00:00 2001 From: stefan schippers Date: Thu, 5 Sep 2024 14:53:36 +0200 Subject: [PATCH] use atof_spice() instead of atof() to read cursor position data from graph attributes --- src/callback.c | 12 ++++++------ src/draw.c | 4 ++-- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/callback.c b/src/callback.c index d61dbb5f..a20e1c82 100644 --- a/src/callback.c +++ b/src/callback.c @@ -242,7 +242,7 @@ void backannotate_at_cursor_b_pos(xRect *r, Graph_ctx *gr) if(r->flags & 4) { /* private_cursor */ const char *s = get_tok_value(r->prop_ptr, "cursor2_x", 0); if(s[0]) { - cursor2 = atof(s); + cursor2 = atof_spice(s); } else { cursor2 = xctx->graph_cursor2_x; } @@ -462,7 +462,7 @@ static int waves_callback(int event, int mx, int my, KeySym key, int button, int if(r->flags & 4) { /* private_cursor */ const char *s = get_tok_value(r->prop_ptr, "cursor2_x", 0); if(s[0]) { - cursor2 = atof(s); + cursor2 = atof_spice(s); } else { cursor2 = xctx->graph_cursor2_x; } @@ -484,7 +484,7 @@ static int waves_callback(int event, int mx, int my, KeySym key, int button, int if(r->flags & 4) { /* private_cursor */ const char *s = get_tok_value(r->prop_ptr, "cursor1_x", 0); if(s[0]) { - cursor1 = atof(s); + cursor1 = atof_spice(s); } else { cursor1 = xctx->graph_cursor1_x; } @@ -515,7 +515,7 @@ static int waves_callback(int event, int mx, int my, KeySym key, int button, int if(r->flags & 4) { /* private_cursor */ const char *s = get_tok_value(r->prop_ptr, "cursor2_x", 0); if(s[0]) { - cursor2 = atof(s); + cursor2 = atof_spice(s); } else { cursor2 = xctx->graph_cursor2_x; } @@ -599,7 +599,7 @@ static int waves_callback(int event, int mx, int my, KeySym key, int button, int if(r->flags & 4) { /* private_cursor */ const char *s = get_tok_value(r->prop_ptr, "cursor1_x", 0); if(s[0]) { - cursor1 = atof(s); + cursor1 = atof_spice(s); } else { cursor1 = xctx->graph_cursor1_x; } @@ -610,7 +610,7 @@ static int waves_callback(int event, int mx, int my, KeySym key, int button, int if(r->flags & 4) { /* private_cursor */ const char *s = get_tok_value(r->prop_ptr, "cursor2_x", 0); if(s[0]) { - cursor2 = atof(s); + cursor2 = atof_spice(s); } else { cursor2 = xctx->graph_cursor2_x; } diff --git a/src/draw.c b/src/draw.c index 4c6f80cd..047fcdd9 100644 --- a/src/draw.c +++ b/src/draw.c @@ -3605,7 +3605,7 @@ void draw_graph(int i, const int flags, Graph_ctx *gr, void *ct) if(r->flags & 4) { /* private_cursor */ const char *s = get_tok_value(r->prop_ptr, "cursor1_x", 0); if(s[0]) { - cursor1 = atof(s); + cursor1 = atof_spice(s); } else { cursor1 = xctx->graph_cursor1_x; } @@ -3616,7 +3616,7 @@ void draw_graph(int i, const int flags, Graph_ctx *gr, void *ct) if(r->flags & 4) { /* private_cursor */ const char *s = get_tok_value(r->prop_ptr, "cursor2_x", 0); if(s[0]) { - cursor2 = atof(s); + cursor2 = atof_spice(s); } else { cursor2 = xctx->graph_cursor2_x; }