Subversion Repositories SvarDOS

Rev

Rev 433 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 433 Rev 437
Line 27... Line 27...
27
 
27
 
28
#include <stdio.h>
28
#include <stdio.h>
29
#include <stdlib.h>
29
#include <stdlib.h>
30
#include <string.h>
30
#include <string.h>
31
 
31
 
32
#include "msgid.h"
-
 
33
 
-
 
34
 
32
 
35
/* read a single line from fd and fills it into dst, returns line length
33
/* read a single line from fd and fills it into dst, returns line length
36
 * ending CR/LF is trimmed, as well as any trailing spaces */
34
 * ending CR/LF is trimmed, as well as any trailing spaces */
37
static unsigned short readl(char *dst, size_t dstsz, FILE *fd) {
35
static unsigned short readl(char *dst, size_t dstsz, FILE *fd) {
38
  unsigned short l, lastnonspace = 0;
36
  unsigned short l, lastnonspace = 0;
Line 199... Line 197...
199
      fd2 = fopen("DEFAULT.LNG", "wb");
197
      fd2 = fopen("DEFAULT.LNG", "wb");
200
      if (fd2 == NULL) {
198
      if (fd2 == NULL) {
201
        puts("ERROR: FAILED TO OPEN OR CREATE DEFAULT.LNG");
199
        puts("ERROR: FAILED TO OPEN OR CREATE DEFAULT.LNG");
202
        break;
200
        break;
203
      }
201
      }
204
      fwrite(buff, 1, sz, fd2);
202
      fwrite(id, 1, 2, fd2);    /* lang block id */
-
 
203
      fwrite(&sz, 1, 2, fd2);   /* lang block size */
-
 
204
      fwrite(buff, 1, sz, fd2); /* langblock content (strings) */
205
      fclose(fd2);
205
      fclose(fd2);
206
    }
206
    }
207
  }
207
  }
208
 
208
 
209
  fclose(fd);
209
  fclose(fd);