[pinpoint] pinpoint: Don't use strchrnul but strchr



commit c15c6acbeea1f05d6f4383c124d0ebf024953c14
Author: Damien Lespiau <damien lespiau intel com>
Date:   Mon May 23 22:28:40 2011 +0100

    pinpoint: Don't use strchrnul but strchr
    
    strchr is way more portable, for instance no strchrnul on Windows. We only use
    strchr when we've checked that a string with '=' exists, strchr can never
    return NULL then.
    
    Looking at it a bit more, it seems like strchrnul("foo", "=") + 1 would have
    returned an address out of bound anyway.

 pinpoint.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/pinpoint.c b/pinpoint.c
index 9e732eb..737cb5d 100644
--- a/pinpoint.c
+++ b/pinpoint.c
@@ -329,8 +329,8 @@ parse_setting (PinPointPoint *point,
 #define END_PARSER   }
 #define IF_PREFIX(prefix) } else if (g_str_has_prefix (setting, prefix)) {
 #define IF_EQUAL(string) } else if (g_str_equal (setting, string)) {
-#define char g_intern_string (strchrnul (setting, '=') + 1)
-#define float g_ascii_strtod (strchrnul (setting, '=') + 1, NULL);
+#define char g_intern_string (strchr (setting, '=') + 1)
+#define float g_ascii_strtod (strchr (setting, '=') + 1, NULL);
 #define enum(r,t,s) \
   do { \
       int _i; \



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]