summaryrefslogtreecommitdiff
path: root/usr/src/uts/common/os/modsysfile.c
diff options
context:
space:
mode:
Diffstat (limited to 'usr/src/uts/common/os/modsysfile.c')
-rw-r--r--usr/src/uts/common/os/modsysfile.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/usr/src/uts/common/os/modsysfile.c b/usr/src/uts/common/os/modsysfile.c
index 690491d8ba..07076f02dd 100644
--- a/usr/src/uts/common/os/modsysfile.c
+++ b/usr/src/uts/common/os/modsysfile.c
@@ -699,9 +699,11 @@ do_sysfile_cmd(struct _buf *file, const char *cmd)
}
*cp++ = (char)ch;
}
- *cp = ':';
- if (isnewline(ch))
+ *cp++ = ':';
+ if (isnewline(ch)) {
+ cp--;
(void) kobj_ungetc(file);
+ }
}
(void) kobj_ungetc(file);
*cp = '\0';