commit eaa0f1a122364546939d905f4181ac74c193a875
parent 9923b073afa750639c108680d926bac92981d300
Author: Benno Schulenberg <bensberg@telfort.nl>
Date: Mon, 5 Nov 2018 13:04:07 +0100
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.)
Diffstat:
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git 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. */