Remove the \n from #version variables
authorBarret Rhoden <brho@cs.berkeley.edu>
Wed, 25 May 2016 17:25:35 +0000 (13:25 -0400)
committerBarret Rhoden <brho@cs.berkeley.edu>
Thu, 16 Jun 2016 15:48:38 +0000 (11:48 -0400)
It's a pain to have that \n for tools that use the output of these strings,
and it doesn't really help for interactive users either.

Signed-off-by: Barret Rhoden <brho@cs.berkeley.edu>
kern/drivers/dev/version.c

index 455cd7e..8419926 100644 (file)
@@ -35,10 +35,10 @@ static long ver_emit_nlstr(char *dest, const char *src, long size,
                                                   long offset)
 {
        long n, slen = strlen(src);
-       char *buf = kmalloc(slen + 2, MEM_WAIT);
+       char *buf = kmalloc(slen + 1, MEM_WAIT);
 
-       snprintf(buf, slen + 2, "%s\n", src);
-       n = readmem(offset, dest, size, buf, slen + 2);
+       snprintf(buf, slen + 1, "%s", src);
+       n = readmem(offset, dest, size, buf, slen + 1);
        kfree(buf);
 
        return n;