Changeset 4525
- Timestamp:
- Jul 8, 2005, 2:31:49 PM (21 years ago)
- File:
-
- 1 edited
-
trunk/Nebulous/nebclient/src/nebclient.c (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Nebulous/nebclient/src/nebclient.c
r4524 r4525 4 4 * Copyright (C) 2005 Joshua Hoblitt 5 5 * 6 * $Id: nebclient.c,v 1.2 3 2005-07-09 00:05:40jhoblitt Exp $6 * $Id: nebclient.c,v 1.24 2005-07-09 00:31:49 jhoblitt Exp $ 7 7 */ 8 8 … … 29 29 static off_t nebCopyFile(nebServer *server, const char *source, const char *dest); 30 30 static off_t nebCopyFilehandle(nebServer *server, int sourceFH, int destFH); 31 static int nebParseURI(nebServer *server, const char *URI, char **filename);31 static size_t nebParseURI(nebServer *server, const char *URI, char **filename); 32 32 static bool nebNukeFile(nebServer *server, const char *filename); 33 33 … … 538 538 } 539 539 540 static int nebParseURI(nebServer *server, const char *URI, char **filename)540 static size_t nebParseURI(nebServer *server, const char *URI, char **filename) 541 541 { 542 542 regex_t myregex; … … 545 545 char *pattern = "^file:(.*)$"; 546 546 int status; 547 int matchStart, matchEnd; 548 int matchLength; 547 size_t matchStart, matchEnd; 548 size_t matchLength; 549 size_t filename_size; 549 550 550 551 if (!URI) { … … 570 571 regfree(&myregex); 571 572 572 matchStart = ( int)mymatch[1].rm_so;573 matchEnd = ( int)mymatch[1].rm_eo;573 matchStart = (size_t)mymatch[1].rm_so; 574 matchEnd = (size_t)mymatch[1].rm_eo; 574 575 matchLength = matchEnd - matchStart; 575 576 … … 578 579 } 579 580 580 *filename = xmalloc(matchLength + 1); 581 582 sprintf(*filename, "%.*s", matchLength, URI + matchStart); 581 filename_size = matchLength + 1; 582 *filename = xmalloc(filename_size); 583 584 snprintf(*filename, filename_size, "%.*s", matchLength, URI + matchStart); 583 585 584 586 return strlen(*filename);
Note:
See TracChangeset
for help on using the changeset viewer.
