]> git.xonotic.org Git - xonotic/gmqcc.git/blobdiff - ansi.c
ir_builder_imm_float: add IR_FLAG_ERASEABLE
[xonotic/gmqcc.git] / ansi.c
diff --git a/ansi.c b/ansi.c
index 4f0cb095a8022758f2b8f3528d8516c7d9663e24..e377424e035014a4560660609138485e1fc5f475 100644 (file)
--- a/ansi.c
+++ b/ansi.c
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2012, 2013
+ * Copyright (C) 2012, 2013, 2014
  *     Dale Weiler
  *
  * Permission is hereby granted, free of charge, to any person obtaining a copy of
@@ -23,7 +23,6 @@
 #define GMQCC_PLATFORM_HEADER
 #include <string.h>
 #include <stdlib.h>
-#include <unistd.h>
 
 #include "platform.h"
 #include "gmqcc.h"
@@ -63,6 +62,9 @@ int platform_vasprintf(char **dat, const char *fmt, va_list args) {
     len = vsnprintf(buf, sizeof(buf), fmt, cpy);
     va_end (cpy);
 
+    if (len < 0)
+        return len;
+
     if (len < (int)sizeof(buf)) {
         *dat = util_strdup(buf);
         return len;