all: Replace strlen() call on const string with sizeof()-1

This commit is contained in:
Pali Rohár committed 2014-10-19 20:23:21 +02:00
1 parent 8d52950ede
commit f0712d5b23
3 files changed
+12 -12

No files matched your search

+1 -1
View File
@@ -495,7 +495,7 @@ int fiasco_unpack(struct fiasco * fiasco, const char * dir) {
if ( image->layout ) {
layout_name = calloc(1, strlen(name) + strlen(".layout") + 1);
layout_name = calloc(1, strlen(name) + sizeof(".layout")-1 + 1);
if ( ! layout_name ) {
free(name);
ALLOC_ERROR_RETURN(-1);