Index: trunk/Nebulous/nebclient/src/nebclient.c
===================================================================
--- trunk/Nebulous/nebclient/src/nebclient.c	(revision 4524)
+++ trunk/Nebulous/nebclient/src/nebclient.c	(revision 4525)
@@ -4,5 +4,5 @@
  * Copyright (C) 2005  Joshua Hoblitt
  *
- * $Id: nebclient.c,v 1.23 2005-07-09 00:05:40 jhoblitt Exp $
+ * $Id: nebclient.c,v 1.24 2005-07-09 00:31:49 jhoblitt Exp $
  */
 
@@ -29,5 +29,5 @@
 static off_t nebCopyFile(nebServer *server, const char *source, const char *dest);
 static off_t nebCopyFilehandle(nebServer *server, int sourceFH, int destFH);
-static int nebParseURI(nebServer *server, const char *URI, char **filename);
+static size_t nebParseURI(nebServer *server, const char *URI, char **filename);
 static bool nebNukeFile(nebServer *server, const char *filename);
 
@@ -538,5 +538,5 @@
 }
 
-static int nebParseURI(nebServer *server, const char *URI, char **filename)
+static size_t nebParseURI(nebServer *server, const char *URI, char **filename)
 {
     regex_t         myregex;
@@ -545,6 +545,7 @@
     char            *pattern = "^file:(.*)$";
     int             status;
-    int             matchStart, matchEnd;
-    int             matchLength;
+    size_t          matchStart, matchEnd;
+    size_t          matchLength;
+    size_t          filename_size;
 
     if (!URI) {
@@ -570,6 +571,6 @@
     regfree(&myregex);
 
-    matchStart = (int)mymatch[1].rm_so;
-    matchEnd   = (int)mymatch[1].rm_eo;
+    matchStart = (size_t)mymatch[1].rm_so;
+    matchEnd   = (size_t)mymatch[1].rm_eo;
     matchLength = matchEnd - matchStart;
 
@@ -578,7 +579,8 @@
     }
 
-    *filename = xmalloc(matchLength + 1);
-
-    sprintf(*filename, "%.*s", matchLength, URI + matchStart);
+    filename_size = matchLength + 1;
+    *filename = xmalloc(filename_size);
+
+    snprintf(*filename, filename_size, "%.*s", matchLength, URI + matchStart);
 
     return strlen(*filename);
