]> git.ipfire.org Git - thirdparty/chrony.git/commitdiff
conf: don't return unused values from parse functions
authorMiroslav Lichvar <mlichvar@redhat.com>
Tue, 18 Mar 2025 13:52:45 +0000 (14:52 +0100)
committerMiroslav Lichvar <mlichvar@redhat.com>
Thu, 20 Mar 2025 14:55:15 +0000 (15:55 +0100)
No need to return success. These functions terminate the process on
errors.

conf.c

diff --git a/conf.c b/conf.c
index e85c775ba49e06718e1dacd3ff19c5c69bec3609..050c91f1827077da46e2b8f6888f4f3915b29a9a 100644 (file)
--- a/conf.c
+++ b/conf.c
 /* ================================================== */
 /* Forward prototypes */
 
-static int parse_string(char *line, char **result);
-static int parse_int(char *line, int *result);
-static int parse_double(char *line, double *result);
+static void parse_string(char *line, char **result);
+static void parse_int(char *line, int *result);
+static void parse_double(char *line, double *result);
 static int parse_null(char *line);
-static int parse_ints(char *line, ARR_Instance array);
+static void parse_ints(char *line, ARR_Instance array);
 
 static void parse_allow_deny(char *line, ARR_Instance restrictions, int allow);
 static void parse_authselectmode(char *);
@@ -790,39 +790,34 @@ CNF_ParseLine(const char *filename, int number, char *line)
 
 /* ================================================== */
 
-static int
+static void
 parse_string(char *line, char **result)
 {
   check_number_of_args(line, 1);
   Free(*result);
   *result = Strdup(line);
-  return 1;
 }
 
 /* ================================================== */
 
-static int
+static void
 parse_int(char *line, int *result)
 {
   check_number_of_args(line, 1);
   if (sscanf(line, "%d", result) != 1) {
     command_parse_error();
-    return 0;
   }
-  return 1;
 }
 
 /* ================================================== */
 
-static int
+static void
 parse_double(char *line, double *result)
 {
   check_number_of_args(line, 1);
   if (sscanf(line, "%lf", result) != 1) {
     command_parse_error();
-    return 0;
   }
-  return 1;
 }
 
 /* ================================================== */
@@ -836,7 +831,7 @@ parse_null(char *line)
 
 /* ================================================== */
 
-static int
+static void
 parse_ints(char *line, ARR_Instance array)
 {
   char *s;
@@ -850,7 +845,6 @@ parse_ints(char *line, ARR_Instance array)
     parse_int(s, &v);
     ARR_AppendElement(array, &v);
   }
-  return 1;
 }
 
 /* ================================================== */