+
+/*
+** mh_xstrdup() is a wrapper of strdup() to replace getcpy(). It returns
+** a copy of its argument if this is nonnull; otherwise, it returns a
+** string of length 0.
+*/
+char *
+mh_xstrdup(char * s)
+{
+ char * tmp;
+ tmp = strdup(s ? s : "");
+ if (!tmp) {
+ adios(EX_OSERR, "strdup", "can't copy string");
+ }
+ return tmp;
+}