summaryrefslogtreecommitdiffstats
path: root/dbus/dbus-sysdeps-util-unix.c
diff options
context:
space:
mode:
Diffstat (limited to 'dbus/dbus-sysdeps-util-unix.c')
-rw-r--r--dbus/dbus-sysdeps-util-unix.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/dbus/dbus-sysdeps-util-unix.c b/dbus/dbus-sysdeps-util-unix.c
index f1e20334..9fa27a1a 100644
--- a/dbus/dbus-sysdeps-util-unix.c
+++ b/dbus/dbus-sysdeps-util-unix.c
@@ -18,7 +18,7 @@
*
* 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
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
*/
#include "dbus-sysdeps.h"
@@ -1149,10 +1149,13 @@ string_squash_nonprintable (DBusString *str)
len = _dbus_string_get_length (str);
for (i = 0; i < len; i++)
- if (buf[i] == '\0')
- buf[i] = ' ';
- else if (buf[i] < 0x20 || buf[i] > 127)
- buf[i] = '?';
+ {
+ unsigned char c = (unsigned char) buf[i];
+ if (c == '\0')
+ c = ' ';
+ else if (c < 0x20 || c > 127)
+ c = '?';
+ }
}
/**