summaryrefslogtreecommitdiffstats
path: root/src/drivers
diff options
context:
space:
mode:
authorMichael Brown2008-05-19 17:34:17 +0200
committerMichael Brown2008-05-19 17:34:17 +0200
commit7d01bf663eb79106ed3fa0a708c36dd10f913697 (patch)
tree2ea0c11171b90e786c89b4247d581ca52e40a053 /src/drivers
parent[tg3] Add support for tg3-5721 (diff)
downloadipxe-7d01bf663eb79106ed3fa0a708c36dd10f913697.tar.gz
ipxe-7d01bf663eb79106ed3fa0a708c36dd10f913697.tar.xz
ipxe-7d01bf663eb79106ed3fa0a708c36dd10f913697.zip
[libc] Fix isdigit(), islower() and isupper().
From: Stefan Hajnoczi <stefanha@gmail.com>
Diffstat (limited to 'src/drivers')
-rw-r--r--src/drivers/net/mlx_ipoib/mt23108.c9
-rw-r--r--src/drivers/net/mlx_ipoib/mt25218.c9
2 files changed, 6 insertions, 12 deletions
diff --git a/src/drivers/net/mlx_ipoib/mt23108.c b/src/drivers/net/mlx_ipoib/mt23108.c
index 492bc901..e1f61db6 100644
--- a/src/drivers/net/mlx_ipoib/mt23108.c
+++ b/src/drivers/net/mlx_ipoib/mt23108.c
@@ -10,6 +10,8 @@ Skeleton NIC driver for Etherboot
* your option) any later version.
*/
+/* to get toupper() */
+#include <ctype.h>
/* to get some global routines like printf */
#include "etherboot.h"
/* to get the interface to the body of the program */
@@ -31,12 +33,7 @@ int prompt_key(int secs, unsigned char *ch_p)
for (tmo = currticks() + secs * TICKS_PER_SEC; currticks() < tmo;) {
if (iskey()) {
- ch = getchar();
- /* toupper does not work ... */
- if (ch == 'v')
- ch = 'V';
- if (ch == 'i')
- ch = 'I';
+ ch = toupper(getchar());
if ((ch=='V') || (ch=='I')) {
*ch_p = ch;
return 1;
diff --git a/src/drivers/net/mlx_ipoib/mt25218.c b/src/drivers/net/mlx_ipoib/mt25218.c
index a603cdeb..8a252eae 100644
--- a/src/drivers/net/mlx_ipoib/mt25218.c
+++ b/src/drivers/net/mlx_ipoib/mt25218.c
@@ -10,6 +10,8 @@ Skeleton NIC driver for Etherboot
* your option) any later version.
*/
+/* to get toupper() */
+#include <ctype.h>
/* to get some global routines like printf */
#include "etherboot.h"
/* to get the interface to the body of the program */
@@ -31,12 +33,7 @@ int prompt_key(int secs, unsigned char *ch_p)
for (tmo = currticks() + secs * TICKS_PER_SEC; currticks() < tmo;) {
if (iskey()) {
- ch = getchar();
- /* toupper does not work ... */
- if (ch == 'v')
- ch = 'V';
- if (ch == 'i')
- ch = 'I';
+ ch = toupper(getchar());
if ((ch=='V') || (ch=='I')) {
*ch_p = ch;
return 1;