From 5c58431646f05637d801c671a5f55a11903b37a5 Mon Sep 17 00:00:00 2001 From: Gertjan van den Burg Date: Thu, 6 Oct 2016 17:08:57 +0200 Subject: Coding style - set all pointers to NULL initially and after free --- src/gensvm_strutil.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src/gensvm_strutil.c') diff --git a/src/gensvm_strutil.c b/src/gensvm_strutil.c index 9762e52..a05f320 100644 --- a/src/gensvm_strutil.c +++ b/src/gensvm_strutil.c @@ -75,7 +75,7 @@ char *get_line(FILE *fid, char *filename, char *buffer) * @brief Read a double from file following a format * * @details - * This function reads a double value from a file. If no value can be found, a + * This function reads a double value from a file. If no value can be found, a * warning is printed to stderr, and NAN is returned. * * @param[in] fid File opened for reading @@ -135,7 +135,8 @@ long all_doubles_str(char *buffer, long offset, double *all_doubles) { double value; long i = 0; - char *start, *end; + char *start = NULL, + *end = NULL; start = buffer + offset; while (true) { @@ -170,7 +171,8 @@ long all_longs_str(char *buffer, long offset, long *all_longs) { long value; long i = 0; - char *start, *end; + char *start = NULL, + *end = NULL; start = buffer + offset; while (true) { -- cgit v1.2.3