X-Git-Url: https://git.xonotic.org/?a=blobdiff_plain;f=ansi.c;h=e377424e035014a4560660609138485e1fc5f475;hb=8b25e9555392e7fced9b4c6241464d1c2824cae3;hp=3cf4508a31f604363b4609b714ccc2506dbc938d;hpb=1d745fd1f9b0448a00140cef0b68d9a3aa73f1f1;p=xonotic%2Fgmqcc.git diff --git a/ansi.c b/ansi.c index 3cf4508..e377424 100644 --- 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 @@ -62,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;