diff src/dirtools.c @ 4:59bf702b2b21

*: stylistic changes
author Paper <mrpapersonic@gmail.com>
date Sun, 14 Aug 2022 13:17:32 -0400
parents 8df8af626dca
children be4835547dd0
line wrap: on
line diff
--- a/src/dirtools.c	Sun Aug 07 22:47:41 2022 -0400
+++ b/src/dirtools.c	Sun Aug 14 13:17:32 2022 -0400
@@ -13,10 +13,11 @@
 }
 
 int dirtools_create_directory(char* path) {
-	char* alltoks = calloc(strlen(path), sizeof(char)), *tok;
+	char* alltoks = calloc(strlen(path)+2, sizeof(char)), *tok;
 
 	for (tok = strtok(path, "\\"); tok != NULL; tok = strtok(NULL, "\\")) {
 		strcat(alltoks, tok);
+		strcat(alltoks, "\\");
 		if (dirtools_directory_exists(path)) {
 			if (!CreateDirectoryA(alltoks, NULL)) {
 				if (GetLastError() == ERROR_PATH_NOT_FOUND) {