]> andersk Git - moira.git/blobdiff - server/mr_util.c
Command line printer manipulation client, and build goo.
[moira.git] / server / mr_util.c
index 6c6e58197c49966c0d94ad3967a91a3f638f1b93..2762bd702b938bd302bbccd628ee899a10104b51 100644 (file)
@@ -38,7 +38,7 @@ char *requote(char *cp)
        }
       else
        {
-         sprintf(op, "\\%03o", *cp++);
+         sprintf(op, "\\%03o", (unsigned char)*cp++);
          op += 4;
          len += 4;
        }
@@ -102,8 +102,7 @@ void mr_com_err(const char *whoami, long code, const char *fmt, va_list pvar)
 
 
 /* mr_trim_args: passed an argument vector, it will trim any trailing
- * spaces on the args by writing a null into the string.  If an argument
- * appears to be binary instead of ASCII, it will not be trimmed.
+ * spaces on the args by writing a null into the string.
  */
 
 int mr_trim_args(int argc, char **argv)
@@ -115,16 +114,6 @@ int mr_trim_args(int argc, char **argv)
     {
       for (lastch = p = (unsigned char *) *arg; *p; p++)
        {
-         /* If any byte in the string has the high bit set, assume
-          * that it is binary and we do not want to trim it.
-          * Setting p = lastch will cause us not to trim the string
-          * when we break out of this inner loop.
-          */
-         if (*p >= 0x80)
-           {
-             p = lastch;
-             break;
-           }
          if (!isspace(*p))
            lastch = p;
        }
@@ -163,7 +152,7 @@ void *xmalloc(size_t bytes)
   if (buf)
     return buf;
 
-  critical_alert("moirad", "Out of memory");
+  critical_alert(whoami, "moirad", "Out of memory");
   exit(1);
 }
 
@@ -174,7 +163,7 @@ void *xrealloc(void *ptr, size_t bytes)
   if (buf)
     return buf;
 
-  critical_alert("moirad", "Out of memory");
+  critical_alert(whoami, "moirad", "Out of memory");
   exit(1);
 }
 
@@ -185,6 +174,6 @@ char *xstrdup(char *str)
   if (buf)
     return buf;
 
-  critical_alert("moirad", "Out of memory");
+  critical_alert(whoami, "moirad", "Out of memory");
   exit(1);
 }
This page took 0.05175 seconds and 4 git commands to generate.