summaryrefslogtreecommitdiff
path: root/string
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>1997-04-17 23:25:08 +0000
committerUlrich Drepper <drepper@redhat.com>1997-04-17 23:25:08 +0000
commitf21e0750a8d69f92bb0c5f07e305f05dc8ce39b0 (patch)
tree1be9205dd5f7253e4eeb7445f235445f187fa6f1 /string
parentf854c0566e2659c192e1790dc2df23899c6e2b1c (diff)
Correctly handle array of odd length.
Diffstat (limited to 'string')
-rw-r--r--string/swab.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/string/swab.c b/string/swab.c
index 9d7858cf96..c9cf7004ea 100644
--- a/string/swab.c
+++ b/string/swab.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1992, 1996 Free Software Foundation, Inc.
+/* Copyright (C) 1992, 1996, 1997 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -21,6 +21,7 @@
void
swab (const char *from, char *to, ssize_t n)
{
+ n &= ~((ssize_t) 1);
while (n > 1)
{
const char b0 = from[--n], b1 = from[--n];