summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorErik Andersen <andersen@codepoet.org>2000-05-14 06:36:48 +0000
committerErik Andersen <andersen@codepoet.org>2000-05-14 06:36:48 +0000
commit557676bdf528741f188f6af0e7bb5f25e29e7d3e (patch)
tree69a82c960d2d17fa6da7cafa88a607a9f0aa9e83
parentc3a27f5095a50bef9e56f19eeed1176319e189e2 (diff)
Work in progress -- cleanups.
-Erik
-rw-r--r--include/stdlib.h2
-rw-r--r--libc/string/config.c3
-rw-r--r--libc/termios/ttyname.c3
3 files changed, 5 insertions, 3 deletions
diff --git a/include/stdlib.h b/include/stdlib.h
index 27c0a5885..622d5ce38 100644
--- a/include/stdlib.h
+++ b/include/stdlib.h
@@ -57,6 +57,8 @@ extern int qsort __P ((char *base, int num, int size, int (*cmp)()));
extern char * gcvt __P ((float number, size_t ndigit, char * buf));
#define atof(x) strtod((x),(char**)0)
+#define atoi(x) (int)strtol((x),(char**)0,10)
+#define atol(x) strtol((x),(char**)0,10)
/* Returned by `div'. */
typedef struct
diff --git a/libc/string/config.c b/libc/string/config.c
index 545207f6a..58716b922 100644
--- a/libc/string/config.c
+++ b/libc/string/config.c
@@ -46,7 +46,6 @@ cfgread(FILE *fp)
char *ebuf;
char *p;
int i;
- int j;
if (!fp) {
errno = EIO;
@@ -86,7 +85,7 @@ cfgfind(FILE *fp, char *var)
strncpy(search, var, sizeof(search));
fseek(fp, 0, SEEK_SET);
- while (ret = cfgread(fp)) {
+ while ((ret = cfgread(fp))) {
if (!strcmp(ret[0], search)) return ret;
}
return (void *)0;
diff --git a/libc/termios/ttyname.c b/libc/termios/ttyname.c
index 897243e71..9fc4f950c 100644
--- a/libc/termios/ttyname.c
+++ b/libc/termios/ttyname.c
@@ -1,5 +1,6 @@
-
#include <errno.h>
+#include <unistd.h>
+#include <string.h>
#include <sys/stat.h>
#include <dirent.h>