git://git.onelab.eu
/
build.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
6e875b0
)
setting terminating null in sourcename rather than fullSource string
author
Marc Fiuczynski
<mef@cs.princeton.edu>
Tue, 20 Nov 2007 20:13:19 +0000
(20:13 +0000)
committer
Marc Fiuczynski
<mef@cs.princeton.edu>
Tue, 20 Nov 2007 20:13:19 +0000
(20:13 +0000)
spec2make.c
patch
|
blob
|
history
diff --git
a/spec2make.c
b/spec2make.c
index
94c9306
..
18bebd8
100644
(file)
--- a/
spec2make.c
+++ b/
spec2make.c
@@
-135,8
+135,9
@@
main(int argc, char *argv[])
suffix_index=strstr(fullSource,*suffix);
if (suffix_index) {
char sourcename[PATH_MAX];
- strncpy(sourcename,fullSource,suffix_index-fullSource);
- *suffix_index='\0';
+ size_t len = (size_t)(suffix_index-fullSource);
+ strncpy(sourcename,fullSource,len);
+ sourcename[len]='\0';
printf ("%s-SOURCE := SOURCES/%s\n",package_name,basename(sourcename));
printf ("%s-CODEBASE := CODEBASES/%s\n",package_name,package_name);
break;