fix
[cparser] / diagnostic.c
index 65e0de2..ad81055 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * This file is part of cparser.
- * Copyright (C) 2007-2008 Matthias Braun <matze@braunis.de>
+ * Copyright (C) 2007-2009 Matthias Braun <matze@braunis.de>
  *
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU General Public License
@@ -40,7 +40,8 @@ static const source_position_t *curr_pos = NULL;
 /**
  * prints an additional source position
  */
-static void print_source_position(FILE *out, const source_position_t *pos) {
+static void print_source_position(FILE *out, const source_position_t *pos)
+{
        fprintf(out, "at line %u", pos->linenr);
        if (curr_pos == NULL || curr_pos->input_name != pos->input_name)
                fprintf(out, " of \"%s\"", pos->input_name);
@@ -66,6 +67,12 @@ static void diagnosticvf(const char *const fmt, va_list ap)
                                        fputc(*f, stderr);
                                        break;
 
+                               case 'C': {
+                                       const wint_t val = va_arg(ap, wint_t);
+                                       fprintf(stderr, "%lc", val);
+                                       break;
+                               }
+
                                case 'c': {
                                        const unsigned char val = (unsigned char) va_arg(ap, int);
                                        fputc(val, stderr);