*/
 
 #include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
 
 #pragma pack(1)
 
 } yuyv_t ;
 
 typedef struct {
-       unsigned char   *data,
+       void                            *data,
                                        *palette ;
        int                             width,
                                        height,
            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 ;
            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);
            }
        }