fix a few warnings reported by cparser
[cparser] / driver / firm_machine.c
index 23a2483..de1bf77 100644 (file)
@@ -2,7 +2,7 @@
 
 #include <assert.h>
 #include <stdbool.h>
-#include "firm_os.h"
+#include "firm_machine.h"
 #include "adt/strutil.h"
 #include "adt/xmalloc.h"
 #include <libfirm/firm.h>
@@ -119,7 +119,7 @@ machine_triple_t *firm_parse_machine_triple(const char *triple_string)
 
        machine_triple_t *triple = XMALLOCZ(machine_triple_t);
 
-       size_t cpu_type_len = manufacturer-cpu+1;
+       size_t cpu_type_len = manufacturer-cpu;
        triple->cpu_type = XMALLOCN(char, cpu_type_len);
        memcpy(triple->cpu_type, cpu, cpu_type_len-1);
        triple->cpu_type[cpu_type_len-1] = '\0';
@@ -130,7 +130,7 @@ machine_triple_t *firm_parse_machine_triple(const char *triple_string)
                triple->manufacturer = xstrdup("unknown");
                os = manufacturer;
        } else {
-               size_t manufacturer_len = os-manufacturer+1;
+               size_t manufacturer_len = os-manufacturer;
                triple->manufacturer = XMALLOCN(char, manufacturer_len);
                memcpy(triple->manufacturer, manufacturer, manufacturer_len-1);
                triple->manufacturer[manufacturer_len-1] = '\0';