All pastes #35872 Raw Edit

Anonymous

public text v1 · immutable
#35872 ·published 2006-01-05 17:37 UTC
rendered paste body
--- q931.c.orig 2006-01-05 12:34:42.000000000 -0500
+++ q931.c      2006-01-05 12:36:22.000000000 -0500
@@ -31,6 +31,7 @@

 #include <unistd.h>
 #include <stdlib.h>
+#include <ctype.h>
 #include <string.h>
 #include <stdio.h>
 #include <limits.h>
@@ -1439,9 +1440,7 @@
        int x=0;
        int lastascii = 0;
        while(len) {
-               if (((*c >= 'A') && (*c <= 'Z')) ||
-                   ((*c >= 'a') && (*c <= 'z')) ||
-                   ((*c >= '0') && (*c <= '9'))) {
+               if (isprint(*c)) {
                        if (!lastascii) {
                                if (*tmp) {
                                        tmp[x++] = ',';