[hackers] [scc] Fix escape() || Roberto E. Vargas Caballero

From: <git_AT_suckless.org>
Date: Thu, 13 Aug 2015 20:02:11 +0200 (CEST)

commit 986532bfe53fc9b4f4bce07d94039cbebffcdb61
Author: Roberto E. Vargas Caballero <k0ga_AT_shike2.com>
AuthorDate: Thu Aug 13 18:13:53 2015 +0200
Commit: Roberto E. Vargas Caballero <k0ga_AT_shike2.com>
CommitDate: Thu Aug 13 18:13:53 2015 +0200

    Fix escape()
    
    Escape() was doing a double increment, discarding the next
    character in the output.

diff --git a/cc1/lex.c b/cc1/lex.c
index 35ff72f..507379e 100644
--- a/cc1/lex.c
+++ b/cc1/lex.c
_AT_@ -291,8 +291,7 @@ escape(void)
 {
         int c, base;
 
- ++input->p;
- switch (*input->p++) {
+ switch (*++input->p) {
         case '\\': return '\\';
         case 'a': return '\a';
         case 'f': return '\f';
Received on Thu Aug 13 2015 - 20:02:11 CEST

This archive was generated by hypermail 2.3.0 : Thu Aug 13 2015 - 20:12:29 CEST