Revert previous commit (r3889). Windows code has to be cleaned before this
change.


git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@3890 3789f03b-4d11-0410-bbf8-ca57d06f2519
diff --git a/unix/tx/TXButton.h b/unix/tx/TXButton.h
index 59a8430..b747279 100644
--- a/unix/tx/TXButton.h
+++ b/unix/tx/TXButton.h
@@ -59,7 +59,7 @@
 
   // setText() changes the text in the button.
   void setText(const char* text_) {
-    text.buf = safe_strdup(text_);
+    text.buf = rfb::strDup(text_);
     int textWidth = XTextWidth(defaultFS, text.buf, strlen(text.buf));
     int textHeight = (defaultFS->ascent + defaultFS->descent);
     int newWidth = __rfbmax(width(), textWidth + xPad*2 + bevel*2);
diff --git a/unix/tx/TXLabel.h b/unix/tx/TXLabel.h
index ebb8403..3d5200d 100644
--- a/unix/tx/TXLabel.h
+++ b/unix/tx/TXLabel.h
@@ -47,7 +47,7 @@
 
   // setText() changes the text in the label.
   void setText(const char* text_) {
-    text.buf = safe_strdup(text_);
+    text.buf = rfb::strDup(text_);
     lines = 0;
     int lineStart = 0;
     int textWidth = 0;
diff --git a/unix/tx/TXMenu.cxx b/unix/tx/TXMenu.cxx
index df57daf..92712f5 100644
--- a/unix/tx/TXMenu.cxx
+++ b/unix/tx/TXMenu.cxx
@@ -56,7 +56,7 @@
 void TXMenu::addEntry(const char* text_, long id_)
 {
   assert(nEntries < maxEntries);
-  text[nEntries] = safe_strdup(text_);
+  text[nEntries] = rfb::strDup(text_);
   checked[nEntries] = false;
   id[nEntries++] = id_;
   int tw = 0;
diff --git a/unix/tx/TXWindow.cxx b/unix/tx/TXWindow.cxx
index 1b695e5..2b535df 100644
--- a/unix/tx/TXWindow.cxx
+++ b/unix/tx/TXWindow.cxx
@@ -93,7 +93,7 @@
   static char tickBits[] = { 0x80, 0xc0, 0xe2, 0x76, 0x3e, 0x1c, 0x08, 0x00};
   tick = XCreateBitmapFromData(dpy, DefaultRootWindow(dpy), tickBits,
                                tickSize, tickSize);
-  defaultWindowClass = safe_strdup(defaultWindowClass_);
+  defaultWindowClass = rfb::strDup(defaultWindowClass_);
 }
 
 void TXWindow::handleXEvents(Display* dpy)
diff --git a/unix/vncviewer/CConn.cxx b/unix/vncviewer/CConn.cxx
index efc3c33..8231f4c 100644
--- a/unix/vncviewer/CConn.cxx
+++ b/unix/vncviewer/CConn.cxx
@@ -221,8 +221,8 @@
   PasswdDialog dlg(dpy, title.buf, !user);
   if (!dlg.show()) throw rfb::Exception("Authentication cancelled");
   if (user)
-    *user = safe_strdup(dlg.userEntry.getText());
-  *password = safe_strdup(dlg.passwdEntry.getText());
+    *user = strDup(dlg.userEntry.getText());
+  *password = strDup(dlg.passwdEntry.getText());
 }
 
 
diff --git a/unix/vncviewer/vncviewer.cxx b/unix/vncviewer/vncviewer.cxx
index 203df9a..4a47788 100644
--- a/unix/vncviewer/vncviewer.cxx
+++ b/unix/vncviewer/vncviewer.cxx
@@ -218,7 +218,7 @@
   if (**vncServerName != '\0')
     *remoteHost = *vncServerName;
 
-  *gatewayHost = safe_strdup (via.getValueStr ());
+  *gatewayHost = strDup (via.getValueStr ());
   *vncServerName = new char[50];
   sprintf (*vncServerName, "localhost::%d", localPort);
 }
diff --git a/unix/x0vncserver/x0vncserver.cxx b/unix/x0vncserver/x0vncserver.cxx
index 3e555ce..ec2fd76 100644
--- a/unix/x0vncserver/x0vncserver.cxx
+++ b/unix/x0vncserver/x0vncserver.cxx
@@ -101,7 +101,7 @@
                                                    const char* userName,
                                                    char** reason) {
     if (queryConnectSock) {
-      *reason = safe_strdup("Another connection is currently being queried.");
+      *reason = strDup("Another connection is currently being queried.");
       return VNCServerST::REJECT;
     }
     if (!userName) userName = "(anonymous)";
diff --git a/unix/xserver/hw/vnc/XserverDesktop.cc b/unix/xserver/hw/vnc/XserverDesktop.cc
index e8e4949..66c92d2 100644
--- a/unix/xserver/hw/vnc/XserverDesktop.cc
+++ b/unix/xserver/hw/vnc/XserverDesktop.cc
@@ -219,7 +219,7 @@
 char* XserverDesktop::substitute(const char* varName)
 {
   if (strcmp(varName, "$$") == 0) {
-    return safe_strdup("$");
+    return rfb::strDup("$");
   }
   if (strcmp(varName, "$PORT") == 0) {
     char* str = new char[10];
@@ -247,7 +247,7 @@
     return str;
   }
   if (strcmp(varName, "$DESKTOP") == 0) {
-    return safe_strdup(server->getName());
+    return rfb::strDup(server->getName());
   }
   if (strcmp(varName, "$DISPLAY") == 0) {
     struct utsname uts;
@@ -260,7 +260,7 @@
   }
   if (strcmp(varName, "$USER") == 0) {
     struct passwd* user = getpwuid(getuid());
-    return safe_strdup(user ? user->pw_name : "?");
+    return rfb::strDup(user ? user->pw_name : "?");
   }
   return 0;
 }
@@ -270,13 +270,13 @@
                                 const char* userName,
                                 char** reason) {
   if (queryConnectId) {
-    *reason = safe_strdup("Another connection is currently being queried.");
+    *reason = strDup("Another connection is currently being queried.");
     return rfb::VNCServerST::REJECT;
   }
   queryConnectAddress.replaceBuf(sock->getPeerAddress());
   if (!userName)
     userName = "(anonymous)";
-  queryConnectUsername.replaceBuf(safe_strdup(userName));
+  queryConnectUsername.replaceBuf(strDup(userName));
   queryConnectId = sock;
   vncQueryConnect(this, sock);
   return rfb::VNCServerST::PENDING;