From: Brett Gordon Date: Tue, 8 Mar 2016 16:38:25 +0000 (-0500) Subject: umount.c: bugfix: not rewriting /etc/mtab correctly. X-Git-Url: https://git.ndcode.org/public/gitweb.cgi?a=commitdiff_plain;h=67af6de2ebb5d9300595f759dc204f21b446e49d;p=FUZIX.git umount.c: bugfix: not rewriting /etc/mtab correctly. --- diff --git a/Applications/util/umount.c b/Applications/util/umount.c index 7e16e682..3d1a8374 100644 --- a/Applications/util/umount.c +++ b/Applications/util/umount.c @@ -34,6 +34,7 @@ int rm_mtab(char *devname) FILE *inpf, *outf; char *tmp_fname; char tmp[MTAB_LINE]; + char tmp2[MTAB_LINE]; char* dev; char* mntpt; @@ -52,11 +53,12 @@ int rm_mtab(char *devname) exit(1); } while (fgets(tmp, sizeof(tmp), inpf)) { + strncpy( tmp2, tmp, MTAB_LINE ); dev = strtok(tmp, " "); if (strcmp(dev, devname) == 0) { continue; } else { - fprintf(outf, "%s", tmp); + fprintf(outf, "%s", tmp2); } } fclose(inpf);