summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorjacksonmj <mj-pt@jacksonmj.co.uk>2011-04-06 15:43:47 (GMT)
committer Simon <simon@hardwired.org.uk>2011-04-08 10:11:03 (GMT)
commit75f6ea610a92d3edac186d2d9b531468fd232f9d (patch)
treea7f9d9097929d9e26904cd2288f8600166c20914 /src
parent4aeac8b316492491f84b9e6ac8b8b9a50e4cb806 (diff)
downloadpowder-75f6ea610a92d3edac186d2d9b531468fd232f9d.zip
powder-75f6ea610a92d3edac186d2d9b531468fd232f9d.tar.gz
More sensible types for path lengths
Now uses the types given in the path function declarations
Diffstat (limited to 'src')
-rw-r--r--src/update.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/update.c b/src/update.c
index e2c6faf..9c4f8d9 100644
--- a/src/update.c
+++ b/src/update.c
@@ -42,11 +42,13 @@
char *exe_name(void)
{
#if defined WIN32
- char *name= (char *)malloc(64), max=64, res;
- while ((res = (char)GetModuleFileName(NULL, name, max)) >= max)
+ char *name= (char *)malloc(64);
+ DWORD max=64, res;
+ while ((res = GetModuleFileName(NULL, name, max)) >= max)
{
#elif defined MACOSX
- char *fn=malloc(64),*name=malloc(PATH_MAX), max=64, res;
+ char *fn=malloc(64),*name=malloc(PATH_MAX);
+ uint32_t max=64, res;
if (_NSGetExecutablePath(fn, &max) != 0)
{
fn = realloc(fn, max);
@@ -60,7 +62,8 @@ char *exe_name(void)
}
res = 1;
#else
- char fn[64], *name=malloc(64), max=64, res;
+ char fn[64], *name=malloc(64);
+ size_t max=64, res;
sprintf(fn, "/proc/self/exe");
memset(name, 0, max);
while ((res = readlink(fn, name, max)) >= max-1)