Skip to content

Commit

Permalink
fix for path
Browse files Browse the repository at this point in the history
  • Loading branch information
maxsupermanhd committed Aug 8, 2019
1 parent 7eb432e commit 43ddc56
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/wmt.c
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,8 @@ int WMT_SearchFilename(char** arr, unsigned short sizearr, char* name, short urg
}

char* WMT_GetMapNameFromFilename(char* filename) {
char* fullpath=filename;
char* fullpath;
if(asprintf(&fullpath, "%s", filename));
int fullpathlen=strlen(fullpath);
int lastindex=-1;
for(int c=0; c<fullpathlen; c++) {
Expand Down
11 changes: 11 additions & 0 deletions lib/wmt.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@
#define WMT_VERSION "1.5"
#endif

#ifndef _GNU_SOURCE
#define _GNU_SOURCE
#endif

#include <stdio.h>
#include <string.h>
#include <stdlib.h>
Expand All @@ -29,6 +33,7 @@

#define MAX_PATH_LEN 2048


/*#ifndef typename(x)
#define typename(x) _Generic((x), \
_Bool: "_Bool", unsigned char: "unsigned char", \
Expand Down Expand Up @@ -177,10 +182,16 @@ struct WZmap {
log_info("Prevented double clean!\n");
return;
}
free(mapname);
mapname = NULL;
free(mapheight);
mapheight = NULL;
free(filenames);
filenames = NULL;
free(structs);
structs = NULL;
free(features);
features = NULL;
for(int i=0; i<totalentries; i++)
free(filenames[i]);
zip_entry_close(zip);
Expand Down

0 comments on commit 43ddc56

Please sign in to comment.