From f9b2a3a18b1c63ab8737a4c3d285dea93a9c5b1a Mon Sep 17 00:00:00 2001 From: kanurag94 Date: Sun, 17 May 2020 00:44:30 +0530 Subject: [PATCH] Fix crashes on blank recording --- src/util/xstdio.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/util/xstdio.cpp b/src/util/xstdio.cpp index e1c62d68..c182af0f 100644 --- a/src/util/xstdio.cpp +++ b/src/util/xstdio.cpp @@ -111,9 +111,9 @@ xio_path xio_getdirectory(xio_constpath filename) xio_path xio_getfilename(const char *basename, const char *extension) { - int pathlength = sizeof(basename) + sizeof(extension); + int pathlength = strlen(basename) + strlen(extension); static char* name; - name = (char* )malloc(pathlength * sizeof (char)); + name = (char* )malloc(pathlength); int nimage = 0; struct stat sb; char *base = xio_fixpath(basename);