Re: [hackers] [PATCH][sbase] libutil/unescape.c: only print argv0 once on error

From: Evan Gates <evan.gates_AT_gmail.com>
Date: Mon, 06 Feb 2017 12:20:23 -0800

Mattias Andrée <maandree_AT_kth.se> wrote:

> Signed-off-by: Mattias Andrée <maandree_AT_kth.se>
> ---
> libutil/unescape.c | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/libutil/unescape.c b/libutil/unescape.c
> index 90a62c3..d1503e6 100644
> --- a/libutil/unescape.c
> +++ b/libutil/unescape.c
> _AT_@ -35,7 +35,7 @@ unescape(char *s)
> (s[m] < 'a' && s[m] > 'f'))
> break;
> if (m == i + 2)
> - eprintf("%s: invalid escape sequence '\\%c'\n", argv0, s[i + 1]);
> + eprintf("invalid escape sequence '\\%c'\n", s[i + 1]);
> off += m - i - 1;
> for (--m, q = 0, factor = 1; m > i + 1; m--) {
> if (s[m] >= '0' && s[m] <= '9')
> _AT_@ -49,14 +49,14 @@ unescape(char *s)
> s[i] = q;
> break;
> case '\0':
> - eprintf("%s: null escape sequence\n", argv0);
> + eprintf("null escape sequence\n");
> default:
> /* "\O[OOO]" octal escape */
> for (m = i + 1; m < i + 1 + 4 && m < len; m++)
> if (s[m] < '0' || s[m] > '7')
> break;
> if (m == i + 1)
> - eprintf("%s: invalid escape sequence '\\%c'\n", argv0, s[i + 1]);
> + eprintf("invalid escape sequence '\\%c'\n", s[i + 1]);
> off += m - i - 1;
> for (--m, q = 0, factor = 1; m > i; m--) {
> q += (s[m] - '0') * factor;
> --
> 2.11.0
>

Thanks, Applied.
Received on Mon Feb 06 2017 - 21:20:23 CET

This archive was generated by hypermail 2.3.0 : Mon Feb 06 2017 - 21:24:17 CET