Hi,
I don't know this codebase, so can't comment on the patch, but the
same bug in util-linux was solved by ditching scanf.
https://github.com/karelzak/util-linux/commit/e902609400a861dbdb47d5c3eb98b951530bf01d
On 4/10/19 4:15 AM, Paul Eggert wrote:
> Bernhard Voelker wrote:
>
> +/* Find the next white space in STR, terminate the string there in place,
> + and return that position. Otherwise return NULL. */
> +
> +static char *
> +terminate_at_blank (char const *str)
> +{
> + char *s = NULL;
> +
Bernhard Voelker wrote:
+/* Find the next white space in STR, terminate the string there in place,
+ and return that position. Otherwise return NULL. */
+
+static char *
+terminate_at_blank (char const *str)
+{
+ char *s = NULL;
+ if ((s = strchr (str, ' ')) != NULL)
+*s = '\0';
+
[adding gnulib, coming from https://bugs.gnu.org/35137]
On 4/5/19 9:01 AM, Bernhard Voelker wrote:
> On 4/4/19 9:52 AM, Zbigniew Jędrzejewski-Szmek wrote:
>> See https://github.com/systemd/systemd/issues/12018 and
>> https://github.com/karelzak/util-linux/issues/780 for additional context.
>>
>>