mirror of
https://github.com/pjreddie/darknet.git
synced 2023-08-10 21:13:14 +03:00
Exit with nonzero status on error
This commit is contained in:
@ -1629,7 +1629,7 @@ image load_image_stb(char *filename, int channels)
|
|||||||
unsigned char *data = stbi_load(filename, &w, &h, &c, channels);
|
unsigned char *data = stbi_load(filename, &w, &h, &c, channels);
|
||||||
if (!data) {
|
if (!data) {
|
||||||
fprintf(stderr, "Cannot load image \"%s\"\nSTB Reason: %s\n", filename, stbi_failure_reason());
|
fprintf(stderr, "Cannot load image \"%s\"\nSTB Reason: %s\n", filename, stbi_failure_reason());
|
||||||
exit(0);
|
exit(1);
|
||||||
}
|
}
|
||||||
if(channels) c = channels;
|
if(channels) c = channels;
|
||||||
int i,j,k;
|
int i,j,k;
|
||||||
|
@ -208,19 +208,19 @@ void error(const char *s)
|
|||||||
{
|
{
|
||||||
perror(s);
|
perror(s);
|
||||||
assert(0);
|
assert(0);
|
||||||
exit(-1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
void malloc_error()
|
void malloc_error()
|
||||||
{
|
{
|
||||||
fprintf(stderr, "Malloc error\n");
|
fprintf(stderr, "Malloc error\n");
|
||||||
exit(-1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
void file_error(char *s)
|
void file_error(char *s)
|
||||||
{
|
{
|
||||||
fprintf(stderr, "Couldn't open file: %s\n", s);
|
fprintf(stderr, "Couldn't open file: %s\n", s);
|
||||||
exit(0);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
list *split_str(char *s, char delim)
|
list *split_str(char *s, char delim)
|
||||||
|
Reference in New Issue
Block a user