X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Flanguage%2Flexer%2Flexer.c;h=8b3f2a48d00474811a09c090f8a82d1b75ed7546;hb=6b003fcaaf12c21fda3d44580154b54c54c6cd54;hp=16195b0dd22303a92f5c3075488f58ec8da5d088;hpb=deb4fd96c0c171fc8eb64f7f1e7f5c2af4931416;p=pspp-builds.git diff --git a/src/language/lexer/lexer.c b/src/language/lexer/lexer.c index 16195b0d..8b3f2a48 100644 --- a/src/language/lexer/lexer.c +++ b/src/language/lexer/lexer.c @@ -1,5 +1,5 @@ /* PSPP - a program for statistical analysis. - Copyright (C) 1997-9, 2000, 2006 Free Software Foundation, Inc. + Copyright (C) 1997-9, 2000, 2006, 2009 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -384,10 +384,10 @@ lex_get (struct lexer *lexer) } else { - if (c_isgraph ((unsigned char) *lexer->prog)) - msg (SE, _("Bad character in input: `%c'."), *lexer->prog++); - else - msg (SE, _("Bad character in input: `\\%o'."), *lexer->prog++); + unsigned char c = *lexer->prog++; + char *c_name = xasprintf (c_isgraph (c) ? "%c" : "\\%o", c); + msg (SE, _("Bad character in input: `%s'."), c_name); + free (c_name); continue; } }