summaryrefslogtreecommitdiff
path: root/apps/language.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/language.c')
-rw-r--r--apps/language.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/apps/language.c b/apps/language.c
index 716ac69020..df8c32a05e 100644
--- a/apps/language.c
+++ b/apps/language.c
@@ -25,12 +25,13 @@
25 25
26static unsigned char language_buffer[MAX_LANGUAGE_SIZE]; 26static unsigned char language_buffer[MAX_LANGUAGE_SIZE];
27 27
28void lang_load(char *filename) 28int lang_load(char *filename)
29{ 29{
30 int filesize; 30 int filesize;
31 int fd = open(filename, O_RDONLY); 31 int fd = open(filename, O_RDONLY);
32 int retcode=0;
32 if(fd == -1) 33 if(fd == -1)
33 return; 34 return 1;
34 filesize = read(fd, language_buffer, MAX_LANGUAGE_SIZE); 35 filesize = read(fd, language_buffer, MAX_LANGUAGE_SIZE);
35 if(filesize != MAX_LANGUAGE_SIZE) { 36 if(filesize != MAX_LANGUAGE_SIZE) {
36 if((language_buffer[0] == LANGUAGE_COOKIE) && 37 if((language_buffer[0] == LANGUAGE_COOKIE) &&
@@ -53,12 +54,15 @@ void lang_load(char *filename)
53 } 54 }
54 else { 55 else {
55 DEBUGF("Illegal language file\n"); 56 DEBUGF("Illegal language file\n");
57 retcode = 2;
56 } 58 }
57 } 59 }
58 else { 60 else {
59 DEBUGF("Language %s too large: %d\n", filename, filesize); 61 DEBUGF("Language %s too large: %d\n", filename, filesize);
62 retcode = 3;
60 } 63 }
61 close(fd); 64 close(fd);
65 return retcode;
62} 66}
63 67
64/* ----------------------------------------------------------------- 68/* -----------------------------------------------------------------