blob: 1da59af9742dc15c9dda086a718e324a976cae60 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
|
$NetBSD: patch-ae,v 1.2 2005/12/11 22:03:39 joerg Exp $
--- tstring.cc.orig 2003-01-27 21:21:17.000000000 +0000
+++ tstring.cc
@@ -27,6 +27,7 @@
#include <unistd.h>
#endif
#include <errno.h>
+#include "config.h"
#include "tstring.h"
#include "texception.h"
@@ -714,12 +715,12 @@ void tstring::truncate(size_t max) {
void tstring::replaceUnprintable(bool only_ascii) {
for(size_t i = 0; i < rep->len; i++) {
- unsigned char& c = (unsigned char)(*rep)[i];
- if(!isprint(c)) {
- if(c < ' ') {
- c = '!';
- } else if(only_ascii || (c < 0xa0)) {
- c = '?';
+ unsigned char *c = (unsigned char*)&(*rep)[i];
+ if(!isprint(*c)) {
+ if(*c < ' ') {
+ *c = '!';
+ } else if(only_ascii || (*c < 0xa0)) {
+ *c = '?';
}
}
}
|