diff options
author | Mike Frysinger <vapier@gentoo.org> | 2007-12-18 03:23:25 -0500 |
---|---|---|
committer | Wolfgang Denk <wd@denx.de> | 2008-01-09 15:09:05 +0100 |
commit | 38d299c2db81bd889c601b5dfc12c4e83ef83333 (patch) | |
tree | babf47533206e2864572331233543a1f498defe5 /tools/easylogo/easylogo.c | |
parent | 883e3925d99a8dd69c5b0201cba5b1887f88f95c (diff) | |
download | u-boot-imx-38d299c2db81bd889c601b5dfc12c4e83ef83333.zip u-boot-imx-38d299c2db81bd889c601b5dfc12c4e83ef83333.tar.gz u-boot-imx-38d299c2db81bd889c601b5dfc12c4e83ef83333.tar.bz2 |
cleanup easylogo
- make the Makefile not suck
- include proper headers for prototypes
- fix obvious broken handling of strchr() when handling '.' in filenames
Signed-Off-By: Mike Frysinger <vapier@gentoo.org>
Diffstat (limited to 'tools/easylogo/easylogo.c')
-rw-r--r-- | tools/easylogo/easylogo.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/tools/easylogo/easylogo.c b/tools/easylogo/easylogo.c index 9f1d1ff..59f9ae7 100644 --- a/tools/easylogo/easylogo.c +++ b/tools/easylogo/easylogo.c @@ -8,6 +8,8 @@ */ #include <stdio.h> +#include <stdlib.h> +#include <string.h> #pragma pack(1) @@ -41,7 +43,7 @@ typedef struct { } yuyv_t ; typedef struct { - unsigned char *data, + void *data, *palette ; int width, height, @@ -352,9 +354,10 @@ int main (int argc, char *argv[]) strcpy (varname, argv[2]); else { - int pos = strchr(inputfile, '.'); + char *dot = strchr(inputfile, '.'); + int pos = dot - inputfile; - if (pos >= 0) + if (dot) { strncpy (varname, inputfile, pos); varname[pos] = 0 ; @@ -365,13 +368,15 @@ int main (int argc, char *argv[]) strcpy (outputfile, argv[3]); else { - int pos = strchr (varname, '.'); + char *dot = strchr (varname, '.'); + int pos = dot - varname; - if (pos > 0) + if (dot) { char app[DEF_FILELEN] ; strncpy(app, varname, pos); + app[pos] = 0; sprintf(outputfile, "%s.h", app); } } |