Began removing $Id$ tags. This will be an ongoing process.
[citadel.git] / libcitadel / lib / html_to_ascii.c
index 90d1103f56e5dbfc629c4c2ca52268978d720b0a..ccf074a48574e8dbb4b15e71cb38da1d15eae401 100644 (file)
@@ -1,22 +1,20 @@
 /*
- * $Id: html.c 6014 2008-02-04 18:38:35Z ajc $
- *
  * Functions which handle translation between HTML and plain text
  * Copyright (c) 2000-2010 by the citadel.org team
  *
- *  This program is free software; you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License as published by
- *  the Free Software Foundation; either version 3 of the License, or
- *  (at your option) any later version.
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3 of the License, or
+ * (at your option) any later version.
  *
- *  This program is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU General Public License for more details.
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
  *
- *  You should have received a copy of the GNU General Public License
- *  along with this program; if not, write to the Free Software
- *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
 #include <stdlib.h>
@@ -570,7 +568,7 @@ char *html_to_ascii(char *inputmsg, int msglen, int screenwidth, int do_citaform
                --output_len;
        }
 
-       if (outptr[output_len-1] != '\n') {
+       if ((output_len > 0) && (outptr[output_len-1] != '\n')) {
                strcat(outptr, "\n");
                ++output_len;
        }