projects
/
xboard.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
(parent:
90f9791
)
Remove use of strndup
author
H.G. Muller
<h.g.muller@hccnet.nl>
Sun, 29 Dec 2013 21:14:06 +0000 (22:14 +0100)
committer
H.G. Muller
<h.g.muller@hccnet.nl>
Sat, 4 Jan 2014 11:41:46 +0000 (12:41 +0100)
The use of strndup was actually unsafe, as the length was passed using
an ordinary strlen. strndup was not availableon OS X 10.6, and is now
replaced by an ordinary strdup, which should be save enough.
gtk/xboard.c
patch
|
blob
|
history
diff --git
a/gtk/xboard.c
b/gtk/xboard.c
index
87a7be3
..
b76faef
100644
(file)
--- a/
gtk/xboard.c
+++ b/
gtk/xboard.c
@@
-2116,7
+2116,7
@@
void FileNamePopUpWrapper(label, def, filter, proc, pathFlag, openMode, name, fp
char *cp;
/* make a copy of the filter string, so that strtok can work with it*/
- cp = strndup(filter,strlen(filter));
+ cp = strdup(filter);
/* add filters for file extensions */
gtkfilter = gtk_file_filter_new();