lib: membuff: fix readline not returning line in case of overflow
[u-boot.git] / include / membuff.h
index 21051b0c54efe87c2549befd5fc6e371318ca3dc..4eba626ce1c2117c1db5baa3137a00382dde4b3e 100644 (file)
@@ -192,10 +192,11 @@ int membuff_free(struct membuff *mb);
  * @mb: membuff to adjust
  * @str: Place to put the line
  * @maxlen: Maximum line length (excluding terminator)
+ * @must_fit: If true then str is empty if line doesn't fit
  * Return: number of bytes read (including terminator) if a line has been
- *        read, 0 if nothing was there
+ *        read, 0 if nothing was there or line didn't fit when must_fit is set
  */
-int membuff_readline(struct membuff *mb, char *str, int maxlen, int minch);
+int membuff_readline(struct membuff *mb, char *str, int maxlen, int minch, bool must_fit);
 
 /**
  * membuff_extend_by() - expand a membuff
This page took 0.029533 seconds and 4 git commands to generate.