Commit 5b78b0db 5b78b0db0a66d5370b8f55cc676d2c431eb580a8 by Sergey Poznyakoff

Use custom ISPRINT macro so we don't depend on the current locale settings.

1 parent 86bcf5c0
......@@ -22,6 +22,8 @@
#include <string.h>
#include <mailutils/mailutils.h>
#define ISPRINT(c) ((c)>=' '&&(c)<127)
int
main (int argc, char * argv [])
{
......@@ -86,7 +88,7 @@ main (int argc, char * argv [])
while (stream_read (flt, &buffer, sizeof (buffer), total, &size) == 0
&& size > 0)
{
if (printable && !isprint (buffer))
if (printable && !ISPRINT (buffer))
{
char outbuf[24];
sprintf (outbuf, "\\%03o", (unsigned int) buffer);
......
......@@ -22,12 +22,14 @@
#include <mailutils/mailutils.h>
#define ISPRINT(c) ((c)=='\t'||(c)==' '||(c)=='\n'||((c)>' '&&(c)<128))
void
print (char *p, int printable)
{
for (; *p; p++)
{
if (printable && *p != '\n' && !isprint (*p))
if (printable && *p != '\n' && !ISPRINT (*p))
printf ("\\%03o", *(unsigned char *) p);
else
putchar (*p);
......