]> code.citadel.org Git - citadel.git/commitdiff
* html.c: don't truncate messages when wacky characters are
authorArt Cancro <ajc@citadel.org>
Wed, 17 Sep 2003 21:40:14 +0000 (21:40 +0000)
committerArt Cancro <ajc@citadel.org>
Wed, 17 Sep 2003 21:40:14 +0000 (21:40 +0000)
  encountered.  Substitute '?' characters instead.  Now the Citadel
  community can complain about b0rken MS ASCII.

citadel/ChangeLog
citadel/commands.c
citadel/html.c

index 9c3e7c662bdefd95f011c98015e667ba881f336e..c53eb56e54a58022e46f2fdfc74846cfe0e78250 100644 (file)
@@ -1,4 +1,9 @@
  $Log$
+ Revision 610.17  2003/09/17 21:40:13  ajc
+ * html.c: don't truncate messages when wacky characters are
+   encountered.  Substitute '?' characters instead.  Now the Citadel
+   community can complain about b0rken MS ASCII.
+
  Revision 610.16  2003/09/13 02:53:04  ajc
  * More intelligent selection of directory to save attachments
 
@@ -5024,3 +5029,4 @@ Sat Jul 11 00:20:48 EDT 1998 Nathan Bryant <bryant@cs.usm.maine.edu>
 
 Fri Jul 10 1998 Art Cancro <ajc@uncensored.citadel.org>
        * Initial CVS import
+
index d969539c1651bef968ce65836dc441b8c582ed74..55ac0045469a3656dfdc00534c92eee12eb11ef3 100644 (file)
@@ -1364,6 +1364,11 @@ int fmout(
                        old = '\n';
                        continue;
                }
+               /* Are we looking at a nonprintable? */
+               if ( (*e < 32) || (*e > 126) ) {
+                       e++;
+                       continue;
+               }
                /* Or are we looking at a space? */
                if (*e == ' ') {
                        e++;
index cda8178491cf4fd684f091a331e25278c85fec8e..ea72a5906ff83e46a3164699db0b71612a7c7090 100644 (file)
@@ -79,8 +79,8 @@ char *html_to_ascii(char *inputmsg, int screenwidth, int do_citaformat) {
                /* Fill the input buffer */
                if ( (done_reading == 0) && (strlen(inbuf) < (SIZ-128)) ) {
 
-                       ch = *inputmsg++;
-                       if (ch > 0) {
+                       ch = *inptr++;
+                       if (ch != 0) {
                                inbuf[strlen(inbuf)+1] = 0;
                                inbuf[strlen(inbuf)] = ch;
                        } 
@@ -98,8 +98,10 @@ char *html_to_ascii(char *inputmsg, int screenwidth, int do_citaformat) {
                        if (inbuf[i]==10) inbuf[i]=32;
                        if (inbuf[i]==13) inbuf[i]=32;
                        if (inbuf[i]==9) inbuf[i]=32;
-                       if ((inbuf[i]<32) || (inbuf[i]>126))
-                               strcpy(&inbuf[i], &inbuf[i+1]);
+                       if ((inbuf[i]<32) || (inbuf[i]>126)) {
+                               inbuf[i] = '?';
+                               /* strcpy(&inbuf[i], &inbuf[i+1]); */
+                       }
                    }
                    for (i=0; i<strlen(inbuf); ++i) {
                        while ((inbuf[i]==32)&&(inbuf[i+1]==32))