From 02ee068cdfdadd10d5c9d0d5aa745a20abd147f5 Mon Sep 17 00:00:00 2001 From: Thadeu Lima de Souza Cascardo Date: Wed, 19 May 2010 15:25:46 -0400 Subject: [PATCH] Return pointers to the character, instead of the character itself. --- helloproc.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/helloproc.c b/helloproc.c index 4fc799b..7e641a4 100644 --- a/helloproc.c +++ b/helloproc.c @@ -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; } -- 2.20.1