Why crash this

Hello
why this crash after few hours

ifstream picture_in (“Data/Rrpictures”, ios::in);

if(!picture_in) {
cout << “cannot open Rrpictures.\n”;
return 1;
}

char picturein[155];
picturein[155] = ‘\0’;

time_t lasttime_p = time(NULL)-NEXTP;

while (!quitProgram) {

if (time(NULL)>lasttime_p+NEXTP){

if (image == NULL) {
   SDL_FillRect(screen, NULL, SDL_MapRGB(screen->format, 0, 0, 0 ));
   SFont_Write (screen, Font2, 100, 500, "No image");
   }

else if (image){
SDL_FreeSurface(image);
}
// SDL_Delay(1);
picture_in.getline(picturein, 154);
image = IMG_Load(picturein);
if (image == NULL){
// cout << “problem with this picture” << ‘\n’;
SDL_FillRect(screen, NULL, SDL_MapRGB(screen->format, 0, 0, 0 ));
SFont_Write (screen, Font2, 100, 500, “Problem in text file -->”);
WarmChannel = Mix_PlayChannel(-1, warm, 4);
}

else if (image){
      src.x = 0;
      src.y = 0;
      src.w = image->w;
      src.h = image->h;
      dest.x = 0;
      dest.y = 35;
      SDL_BlitSurface(image, &src, screen, &dest);
      SDL_BlitSurface(Picture, NULL, screen, &dest);//&Picture_Rectangle
      SDL_UpdateRect(screen,0, 0, 0, 0);

}
cout << picturein << ‘\n’;
lasttime_p = time(NULL);

 if (picture_in.eof()){
     picture_in.clear();
     picture_in.seekg(0, ios::beg);
     cout << "EOF image" << '\n';
    }

}
while (SDL_PollEvent (&event)) {


}
}

picture_in.close();
return 0;
}

pls can help me anyone, what i am doin wrong here?

BTW: why this not working if the file text is in DOS format?

ppap_________________________________________________________________
The new MSN 8: advanced junk mail protection and 2 months FREE*
http://join.msn.com/?page=features/junkmail

char picturein[155];
picturein[155] = ‘\0’;

Well I haven’t looked TOO CLOSELY at your code, but this one stuck out
at me.On Oct 1, 2004, at 4:13 AM, petros ppap wrote:

char picturein[155];
picturein[155] = ‘\0’;

i have the idea that ‘\0’ need for the text, of course i make mistake
is very simple code, just make loop over and over, reads the text file and
display the pictures
but why i run out of memory, pls point me what to do to fix this

ppap_________________________________________________________________
The new MSN 8: smart spam protection and 2 months FREE*
http://join.msn.com/?page=features/junkmail

picturein[154] = 0

or

char picturein[156]

Gabriel Gambetta
ARTech - Development Team
ggambett at artech.com.uy> ----- Original Message -----

From: petros ppap [mailto:sibas11@hotmail.com]
Sent: Viernes, 01 de Octubre de 2004 11:29 a.m.
To: sdl at libsdl.org
Subject: [SDL] why crash this

char picturein[155];
picturein[155] = ‘\0’;

i have the idea that ‘\0’ need for the text, of course i make mistake
is very simple code, just make loop over and over, reads the text file
and
display the pictures
but why i run out of memory, pls point me what to do to fix this

ppap


The new MSN 8: smart spam protection and 2 months FREE*
http://join.msn.com/?page=features/junkmail


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl