summaryrefslogtreecommitdiff
path: root/src/lib/embryo
diff options
context:
space:
mode:
authorCarsten Haitzler (Rasterman) <raster@rasterman.com>2013-07-16 16:57:14 +0900
committerCarsten Haitzler (Rasterman) <raster@rasterman.com>2013-07-16 16:57:14 +0900
commit7f2eafc8f170833723a73e89d1d433c251b0f851 (patch)
tree49e4ae265f18ea822e5eb325d2d5b278311d3b8b /src/lib/embryo
parentaaf5a5531921f890c18182c82556e387dec335ea (diff)
fix clang nonnull report
Diffstat (limited to 'src/lib/embryo')
-rw-r--r--src/lib/embryo/embryo_str.c21
1 files changed, 12 insertions, 9 deletions
diff --git a/src/lib/embryo/embryo_str.c b/src/lib/embryo/embryo_str.c
index 3f180cef00..d213f61f01 100644
--- a/src/lib/embryo/embryo_str.c
+++ b/src/lib/embryo/embryo_str.c
@@ -382,15 +382,18 @@ _embryo_str_snprintf(Embryo_Program *ep, Embryo_Cell *params)
382 int l; 382 int l;
383 383
384 STRGET(ep, tmp, params[4 + p]); 384 STRGET(ep, tmp, params[4 + p]);
385 l = strlen(tmp); 385 if (tmp)
386 if ((o + l) > (params[2] - 1)) 386 {
387 { 387 l = strlen(tmp);
388 l = params[2] - 1 - o; 388 if ((o + l) > (params[2] - 1))
389 if (l < 0) l = 0; 389 {
390 tmp[l] = 0; 390 l = params[2] - 1 - o;
391 } 391 if (l < 0) l = 0;
392 strcpy(s2 + o, tmp); 392 tmp[l] = 0;
393 o += l; 393 }
394 strcpy(s2 + o, tmp);
395 o += l;
396 }
394 p++; 397 p++;
395 } 398 }
396 break; 399 break;