return 255;
}
- EreadlinkD(runfile, dstfile, sizeof(dstfile));
- len = utilvserver_fmt_uint(buf, ctx);
+ len = EreadlinkD(runfile, dstfile, sizeof(dstfile)-1);
+ dstfile[len] = '\0';
+ len = utilvserver_fmt_uint(buf, ctx);
fd = EopenD(dstfile, O_EXCL|O_CREAT|O_WRONLY, 0644);
if (write(fd, buf, len) !=len ||
Eclose(fd);
strcat(runfile, ".rev/");
- strcat(runfile, buf);
+ strncat(runfile, buf, len);
unlink(runfile);
EsymlinkD(argv[1], runfile);