diff options
author | px4dev <px4@purgatory.org> | 2012-08-14 09:07:59 -0700 |
---|---|---|
committer | px4dev <px4@purgatory.org> | 2012-08-14 09:07:59 -0700 |
commit | 74980af6c94372e49619b905e9b1b4565930e68a (patch) | |
tree | d902ff890bb38f20c01ecd0cf0428e05d4f3ca2a /nuttx/lib/stdio/lib_stdinstream.c | |
parent | 34118c72ef88d33d0074914c9bf0cda0232e4940 (diff) | |
parent | 3cc812dbad530e36360a992da9bc4533c016d98d (diff) | |
download | px4-firmware-74980af6c94372e49619b905e9b1b4565930e68a.tar.gz px4-firmware-74980af6c94372e49619b905e9b1b4565930e68a.tar.bz2 px4-firmware-74980af6c94372e49619b905e9b1b4565930e68a.zip |
Merge branch 'NuttX/master' from git-svn-id: https://nuttx.svn.sourceforge.net/svnroot/nuttx/trunk@5027 7fd9a85b-ad96-42d3-883c-3090e2eb8679
Diffstat (limited to 'nuttx/lib/stdio/lib_stdinstream.c')
-rw-r--r-- | nuttx/lib/stdio/lib_stdinstream.c | 25 |
1 files changed, 15 insertions, 10 deletions
diff --git a/nuttx/lib/stdio/lib_stdinstream.c b/nuttx/lib/stdio/lib_stdinstream.c index d89b6b63a..77aab9ec8 100644 --- a/nuttx/lib/stdio/lib_stdinstream.c +++ b/nuttx/lib/stdio/lib_stdinstream.c @@ -1,8 +1,8 @@ /**************************************************************************** * lib/stdio/lib_stdinstream.c * - * Copyright (C) 2007-2009, 2011 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt <spudmonkey@racsa.co.cr> + * Copyright (C) 2007-2009, 2011-2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt <gnutt@nuttx.org> * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -37,6 +37,8 @@ * Included Files ****************************************************************************/ +#include <assert.h> + #include "lib_internal.h" /**************************************************************************** @@ -50,16 +52,19 @@ static int stdinstream_getc(FAR struct lib_instream_s *this) { FAR struct lib_stdinstream_s *sthis = (FAR struct lib_stdinstream_s *)this; - if (this) + int ret; + + DEBUGASSERT(this); + + /* Get the next character from the incoming stream */ + + ret = getc(sthis->stream); + if (ret != EOF) { - int ret = getc(sthis->stream); - if (ret != EOF) - { - this->nget++; - } - return ret; + this->nget++; } - return EOF; + + return ret; } /**************************************************************************** |