LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   strange file creation problem (https://www.linuxquestions.org/questions/programming-9/strange-file-creation-problem-239565/)

dizzutch 10-06-2004 06:26 PM

strange file creation problem
 
Hey all,
I'm trying to do some manipulation to bitmaps, which works fine, but when i try to export the created bitmap to disk, say to file morph000.bmp the file created will be morph000.bmpi? (including the questionmark) I'm really not sure what causes this error.
any ideas are appreciated.
Thanks!
-JSS

Code:

    if (disk_save)  {
      filename = (char*)malloc(10*sizeof(char));
      sprintf(filename,"morph%03d.bmp", t);
      SaveDIBitmap(filename, Bitmap1Info,  buffer[t]);
    }

SaveDIBitmap()
Code:

if ((fp = fopen(filename, "wb")) == NULL)
        return (-1);
  ...
  fclose(fp)


dizzutch 10-06-2004 06:30 PM

never mind, not allocating enough space..duh

-JSS


All times are GMT -5. The time now is 12:29 AM.