From eaa0f1a122364546939d905f4181ac74c193a875 Mon Sep 17 00:00:00 2001 From: Benno Schulenberg Date: Mon, 5 Nov 2018 13:04:07 +0100 Subject: [PATCH] tweaks: remove an unneeded check for NULL, and rename a parameter (And if it were NULL, it should crash instead of passing over the bug.) --- src/utils.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/utils.c b/src/utils.c index 458e677d..406c6aa1 100644 --- a/src/utils.c +++ b/src/utils.c @@ -160,10 +160,9 @@ bool parse_line_column(const char *str, ssize_t *line, ssize_t *column) } /* Reduce the memory allocation of a string to what is needed. */ -void snuggly_fit(char **str) +void snuggly_fit(char **string) { - if (*str != NULL) - *str = charealloc(*str, strlen(*str) + 1); + *string = charealloc(*string, strlen(*string) + 1); } /* Null a string at a certain index and align it. */