gustavonihei commented on a change in pull request #3808:
URL: https://github.com/apache/incubator-nuttx/pull/3808#discussion_r642492881
##########
File path: drivers/syslog/ramlog.c
##########
@@ -639,6 +643,60 @@ int ramlog_poll(FAR struct file *filep, FAR struct pollfd
*fds, bool setup)
return ret;
}
+/****************************************************************************
+ * Name: ramlog_initbuf
+ *
+ * Description:
+ * Initialize g_sysdev based on the current system ramlog buffer.
+ *
+ ****************************************************************************/
+
+#ifdef CONFIG_RAMLOG_SYSLOG
+static void ramlog_initbuf(void)
+{
+ FAR struct ramlog_dev_s *priv = &g_sysdev;
+ char prev, cur;
+ size_t i;
+
+ if (priv->rl_head != CONFIG_RAMLOG_BUFSIZE ||
+ priv->rl_tail != CONFIG_RAMLOG_BUFSIZE)
+ {
+ return;
+ }
+
+ prev = priv->rl_buffer[priv->rl_bufsize - 1];
+
+ for (i = 0; i < priv->rl_bufsize; i++)
+ {
+ cur = priv->rl_buffer[i];
+
+ if (!isascii(cur))
+ {
+ goto out;
+ }
+
+ if (prev && !cur)
+ {
+ priv->rl_head = i;
+ }
+
+ if (!prev && cur)
+ {
+ priv->rl_tail = i;
+ }
+
+ prev = cur;
+ }
+
+out:
+ if (i != priv->rl_bufsize)
+ {
+ priv->rl_head = priv->rl_tail = 0;
Review comment:
```suggestion
priv->rl_head = 0;
priv->rl_tail = 0;
```
This is a violation to the One Statement per Line rule of the coding
standard:
https://cwiki.apache.org/confluence/display/NUTTX/Coding+Standard#onestatement
--
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:
[email protected]