ref: 4b787e3205592f1fb4ff933dd6288f7c0d77f616
parent: d7f4ef7bbced0b912164f110fc7337d3b77fae9b
author: cinap_lenrek <cinap_lenrek@felloff.net>
date: Mon Aug 3 10:52:07 EDT 2015
bitsy/keyboard: do not rely on atoi() being able to parse hex
--- a/sys/src/cmd/bitsy/keyboard.c
+++ b/sys/src/cmd/bitsy/keyboard.c
@@ -363,7 +363,7 @@
if(n == 3)
if(strcmp(args[0], "keyboard:")==0 || strcmp(args[0], "scribble:")==0)
if(strcmp(args[1], "value") == 0){
- n = atoi(args[2]);
+ n = strtol(args[2], 0, 0);
if(n <= Runemax){
r = n;
i = runetochar(str, &r);
--- a/sys/src/cmd/bitsy/prompter.c
+++ b/sys/src/cmd/bitsy/prompter.c
@@ -279,7 +279,7 @@
if(n == 3)
if(strcmp(args[0], "keyboard:")==0 || strcmp(args[0], "scribble:")==0)
if(strcmp(args[1], "value") == 0){
- n = atoi(args[2]);
+ n = strtol(args[2], 0, 0);
if(n == '\033') /* Escape exits */
break;
if(n <= Runemax){