summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNick Foster <nick@nerdnetworks.org>2010-08-13 16:18:02 -0700
committerNick Foster <nick@nerdnetworks.org>2010-08-13 16:18:02 -0700
commitac899c005274ff974565c8ab5c125c51feed4d69 (patch)
treec621dbd992dbfe3cae021f7f27b2818a8c7ed082
parent727d8711f94bf7fe634fc33659b77bc4b4884d9c (diff)
downloaduhd-ac899c005274ff974565c8ab5c125c51feed4d69.tar.gz
uhd-ac899c005274ff974565c8ab5c125c51feed4d69.tar.bz2
uhd-ac899c005274ff974565c8ab5c125c51feed4d69.zip
Small fix for fngets
-rw-r--r--firmware/microblaze/lib/hal_io.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/firmware/microblaze/lib/hal_io.c b/firmware/microblaze/lib/hal_io.c
index f93b20030..a8654bce7 100644
--- a/firmware/microblaze/lib/hal_io.c
+++ b/firmware/microblaze/lib/hal_io.c
@@ -249,7 +249,7 @@ fngets(hal_uart_name_t u, char * const s, int len)
char *x = s;
while(((*x=(char)hal_uart_getc(u)) != '\n') && ((x-s) < len)) x++;
*x = 0;
- return (x-s)-1;
+ return (x-s);
}
int
@@ -259,7 +259,7 @@ fngets_timeout(hal_uart_name_t u, char * const s, int len)
while(((*x=(char)hal_uart_getc_timeout(u)) != '\n') && ((x-s) < len)) x++;
*x = 0;
if(x==s) return 0;
- return (x-s)-1;
+ return (x-s);
}
char *