Ticket #46840: io_compile.patch

File io_compile.patch, 621 bytes (added by RJVB (René Bertin), 9 years ago)
  • src/io.c

    old new  
    19031903        }
    19041904
    19051905        strcpy(str,"");
    1906         fgets(str,MAXLINE,fpin);
     1906        if (fgets(str,MAXLINE,fpin) == NULL)
     1907                g_error("fgets error\n");
    19071908
    19081909        if (pclose(fpin) == -1) {
    19091910                g_error("pclose error\n");
     
    47204721        dolog(3, "Saving extended output to %s\n", fname);
    47214722
    47224723        /* write to file */
    4723         fd = open(fname,O_WRONLY | O_CREAT);
     4724        fd = open(fname, O_WRONLY | O_CREAT, S_IRUSR | S_IWUSR);
    47244725        if (fd < 0) {
    47254726                g_warning("Can't open file %s for writing\n",fname);
    47264727                return 1;