summaryrefslogtreecommitdiff
path: root/examples/c/ex_encrypt.c
diff options
context:
space:
mode:
Diffstat (limited to 'examples/c/ex_encrypt.c')
-rw-r--r--examples/c/ex_encrypt.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/examples/c/ex_encrypt.c b/examples/c/ex_encrypt.c
index a919148aff0..3b3323bc091 100644
--- a/examples/c/ex_encrypt.c
+++ b/examples/c/ex_encrypt.c
@@ -122,8 +122,8 @@ do_rotate(char *buf, size_t len, int rotn)
* Now rotate
*/
for (i = 0; i < len; i++)
- if (isalpha(buf[i])) {
- if (islower(buf[i]))
+ if (isalpha((unsigned char)buf[i])) {
+ if (islower((unsigned char)buf[i]))
buf[i] = ((buf[i] - 'a') + rotn) % 26 + 'a';
else
buf[i] = ((buf[i] - 'A') + rotn) % 26 + 'A';