From 0a13b12ce42b0656a6a1b12405ece34fda5dbe26 Mon Sep 17 00:00:00 2001 From: H.G. Muller Date: Sun, 29 Dec 2013 22:14:06 +0100 Subject: [PATCH] Remove use of strndup 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 | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/gtk/xboard.c b/gtk/xboard.c index 60b50d1..4f1fc8c 100644 --- a/gtk/xboard.c +++ b/gtk/xboard.c @@ -2117,7 +2117,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(); -- 1.7.0.4