You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by GitBox <gi...@apache.org> on 2020/06/02 19:39:40 UTC

[GitHub] [incubator-nuttx] patacongo commented on a change in pull request #1180: libc: Remove the up_romgetc support from fgets

patacongo commented on a change in pull request #1180:
URL: https://github.com/apache/incubator-nuttx/pull/1180#discussion_r434131699



##########
File path: libs/libc/stdio/lib_fputs.c
##########
@@ -59,51 +59,6 @@
  *
  ****************************************************************************/
 
-#if defined(CONFIG_ARCH_ROMGETC)
-int fputs(FAR const char *s, FAR FILE *stream)
-{
-  int nput;
-  int ret;
-  char ch;
-
-  /* Make sure that a string was provided. */
-
-#ifdef CONFIG_DEBUG_FEATURES /* Most parameter checking is disabled if DEBUG is off */
-  if (!s)
-    {
-      set_errno(EINVAL);
-      return EOF;
-    }
-#endif
-
-  /* Write the string.  Loop until the null terminator is encountered */
-
-  for (nput = 0, ch = up_romgetc(s); ch; nput++, s++, ch = up_romgetc(s))
-    {
-      /* Write the next character to the stream buffer */
-
-      ret = lib_fwrite(&ch, 1, stream);
-      if (ret <= 0)
-        {
-          return EOF;
-        }
-
-      /* Flush the buffer if a newline was written to the buffer */
-
-      if (ch == '\n' && (stream->fs_flags & __FS_FLAG_LBF) != 0)
-        {
-          ret = lib_fflush(stream, true);
-          if (ret < 0)
-            {
-              return EOF;
-            }
-        }
-    }
-
-  return nput;
-}
-
-#else
 int fputs(FAR const char *s, FAR FILE *stream)

Review comment:
       ```suggestion
   int fputs(FAR const char *s, FAR  IPTR FILE *stream)
   ```




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org