Return pointers to the character, instead of the character itself. master
authorThadeu Lima de Souza Cascardo <cascardo@holoscopio.com>
Wed, 19 May 2010 19:25:46 +0000 (15:25 -0400)
committerThadeu Lima de Souza Cascardo <cascardo@holoscopio.com>
Wed, 19 May 2010 19:25:46 +0000 (15:25 -0400)
helloproc.c

index 4fc799b..7e641a4 100644 (file)
@@ -30,7 +30,7 @@ static void *hp_start(struct seq_file *s, loff_t *pos)
        *pos += 1;
        if (hp_pos >= sizeof(hello))
                return NULL;
-       return (void *) hello[hp_pos];
+       return &hello[hp_pos];
 }
 
 static void hp_stop(struct seq_file *s, void *v)
@@ -44,12 +44,12 @@ static void *hp_next(struct seq_file *s, void *v, loff_t *pos)
        *pos += 1;
        if (hp_pos >= sizeof(hello))
                return NULL;
-       return (void *) hello[hp_pos];
+       return &hello[hp_pos];
 }
 
 static int hp_show(struct seq_file *s, void *v)
 {
-       seq_putc(s, (char) v);
+       seq_putc(s, *(char *)v);
        return 0;
 }