[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Search]

patch: making tclspeak.cpp more portable



Removed unused include "dlfcn.h".
Replaced one remaining strdup call with an equivalent call to strcpy, which is more portable. strdup is present only on Posix systems, it is not part of C library.

Index: servers/linux-espeak/tclespeak.cpp
===================================================================
--- servers/linux-espeak/tclespeak.cpp	(revision 8407)
+++ servers/linux-espeak/tclespeak.cpp	(working copy)
@@ -36,7 +36,6 @@
 //<includes
 
 #include <sys/time.h>
-#include <dlfcn.h>
 #include <tcl.h>
 #include <string.h>
 #include <stdlib.h>
@@ -246,7 +245,8 @@
 
 static bool closeTags(string input, string& output)
 {
-  char* tag_orig = strdup(input.c_str());
+  char* tag_orig = (char*)malloc(sizeof(char) * (input.size()+1));
+  strcpy(tag_orig, input.c_str());
   output = "";
 
   // check that a text (non whitespace) is present


If you have questions about this archive or had problems using it, please send mail to:

priestdo@xxxxxxxxxxx No Soliciting!

Emacspeak List Archive | 2010 | 2009 | 2008 | 2007 | 2006 | 2005 | 2004 | 2003 | 2002 | 2001 | 2000 | 1999 | 1998 | Pre 1998

Emacspeak Files | Emacspeak Blog