<feed xmlns='http://www.w3.org/2005/Atom'>
<title>opensbi.git/lib/sbi/sbi_console.c, branch v1.4</title>
<subtitle>Unnamed repository; edit this file 'description' to name the repository.</subtitle>
<id>http://cgit.235523.xyz/opensbi.git/atom/lib/sbi/sbi_console.c?h=v1.4</id>
<link rel='self' href='http://cgit.235523.xyz/opensbi.git/atom/lib/sbi/sbi_console.c?h=v1.4'/>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/opensbi.git/'/>
<updated>2023-11-17T10:33:21Z</updated>
<entry>
<title>lib: sbi: Make console_puts/console_putc interchangeable</title>
<updated>2023-11-17T10:33:21Z</updated>
<author>
<name>Xiang W</name>
<email>wxjstz@126.com</email>
</author>
<published>2023-11-17T01:03:58Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/opensbi.git/commit/?id=3aaed4fadfce9e02823c813bd5a69a84376b3397'/>
<id>urn:sha1:3aaed4fadfce9e02823c813bd5a69a84376b3397</id>
<content type='text'>
console_puts/console_putc should replace each other, but the previous
sbi_putc can only use console_putc. This patch addresses this problem.

Signed-off-by: Xiang W &lt;wxjstz@126.com&gt;
Reviewed-by: Guo Ren &lt;guoren@kernel.org&gt;
Reviewed-by: Anup Patel &lt;anup@brainfault.org&gt;
</content>
</entry>
<entry>
<title>lib: sbi: Fix missing '\0' when buffer szie equal 1</title>
<updated>2023-07-12T05:07:43Z</updated>
<author>
<name>Xiang W</name>
<email>wxjstz@126.com</email>
</author>
<published>2023-07-09T16:03:26Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/opensbi.git/commit/?id=a73982d7376a71cf6e230b255069da46fe2becc9'/>
<id>urn:sha1:a73982d7376a71cf6e230b255069da46fe2becc9</id>
<content type='text'>
Fix special case: sbi_snprintf(out, out_len, ...) when out_len equal
1, The previous code will not fill the buffer with any char.

Signed-off-by: Xiang W &lt;wxjstz@126.com&gt;
Reviewed-by: Anup Patel &lt;anup@brainfault.org&gt;
</content>
</entry>
<entry>
<title>lib: sbi: Fix timing of clearing tbuf</title>
<updated>2023-07-12T05:07:16Z</updated>
<author>
<name>Xiang W</name>
<email>wxjstz@126.com</email>
</author>
<published>2023-07-09T16:02:30Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/opensbi.git/commit/?id=ff43168137a4890fe65460c1506fdf08c26bebad'/>
<id>urn:sha1:ff43168137a4890fe65460c1506fdf08c26bebad</id>
<content type='text'>
A single scan of the format char may add multiple characters to the
tbuf, causing a buffer overflow. You should check if tbuf is full in
printc so that it does not cause a buffer overflow.

Signed-off-by: Xiang W &lt;wxjstz@126.com&gt;
Reviewed-by: Anup Patel &lt;anup@brainfault.org&gt;
</content>
</entry>
<entry>
<title>lib: sbi: Fix printc</title>
<updated>2023-07-12T04:32:27Z</updated>
<author>
<name>Xiang W</name>
<email>wxjstz@126.com</email>
</author>
<published>2023-07-09T16:02:29Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/opensbi.git/commit/?id=cc89fa7b5481b3279f1628f71debf795d5618044'/>
<id>urn:sha1:cc89fa7b5481b3279f1628f71debf795d5618044</id>
<content type='text'>
Because *out needs to reserve a byte to hold '\0', no more characters
should be added to the buffer when *out has one byte left, and the
buffer size *out_len should not be modified. this patch prevents
the correction of *out_len when *out_len is 1.

Signed-off-by: Xiang W &lt;wxjstz@126.com&gt;
Reviewed-by: Anup Patel &lt;anup@brainfault.org&gt;
</content>
</entry>
<entry>
<title>lib: sbi: Simplify prints</title>
<updated>2023-07-12T04:32:06Z</updated>
<author>
<name>Xiang W</name>
<email>wxjstz@126.com</email>
</author>
<published>2023-07-09T16:02:28Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/opensbi.git/commit/?id=3b6fcddcebf82bb58ac750a2ab4d6e22d7549ac9'/>
<id>urn:sha1:3b6fcddcebf82bb58ac750a2ab4d6e22d7549ac9</id>
<content type='text'>
When doing width = width - strlen(string) in prints there is no need
to consider the case that witdh may be less than 0. This is because
the code to do filling needs to be executed under the condition that
width &gt; 0.

Signed-off-by: Xiang W &lt;wxjstz@126.com&gt;
Reviewed-by: Anup Patel &lt;anup@brainfault.org&gt;
</content>
</entry>
<entry>
<title>lib: sbi: Fix printi</title>
<updated>2023-07-12T04:31:43Z</updated>
<author>
<name>Xiang W</name>
<email>wxjstz@126.com</email>
</author>
<published>2023-07-09T16:02:27Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/opensbi.git/commit/?id=c6ee5ae5a485335fa28a5f74811f900d8da9f87d'/>
<id>urn:sha1:c6ee5ae5a485335fa28a5f74811f900d8da9f87d</id>
<content type='text'>
Fix two bug:
&gt; printf("%#08x", 0x123); /* print 0000x123 */
&gt; printf("%#x", 0); /* print 0x0 */

Signed-off-by: Xiang W &lt;wxjstz@126.com&gt;
Reviewed-by: Anup Patel &lt;anup@brainfault.org&gt;
</content>
</entry>
<entry>
<title>lib: sbi: print add 'o' type</title>
<updated>2023-07-12T04:29:22Z</updated>
<author>
<name>Xiang W</name>
<email>wxjstz@126.com</email>
</author>
<published>2023-07-09T16:02:26Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/opensbi.git/commit/?id=fe0828142fa34a95b6933dd94e68ed528d4c5778'/>
<id>urn:sha1:fe0828142fa34a95b6933dd94e68ed528d4c5778</id>
<content type='text'>
Add o type for print to print octal numbers

Signed-off-by: Xiang W &lt;wxjstz@126.com&gt;
Reviewed-by: Anup Patel &lt;anup@brainfault.org&gt;
</content>
</entry>
<entry>
<title>lib: sbi: implifying the parameters of printi</title>
<updated>2023-07-12T04:28:52Z</updated>
<author>
<name>Xiang W</name>
<email>wxjstz@126.com</email>
</author>
<published>2023-07-09T16:02:25Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/opensbi.git/commit/?id=05cbb6e908a469f152d0253cfdf7c1aa2bda820d'/>
<id>urn:sha1:05cbb6e908a469f152d0253cfdf7c1aa2bda820d</id>
<content type='text'>
The information of sg/b/letbase can be obtained by the type character,
simplifying the parameter by passing the type directly.

Signed-off-by: Xiang W &lt;wxjstz@126.com&gt;
Reviewed-by: Anup Patel &lt;anup@brainfault.org&gt;
</content>
</entry>
<entry>
<title>lib: sbi: Add ' ' '\'' flags for print</title>
<updated>2023-07-12T04:28:00Z</updated>
<author>
<name>Xiang W</name>
<email>wxjstz@126.com</email>
</author>
<published>2023-07-09T16:02:24Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/opensbi.git/commit/?id=458fa742663f889033b87b6d866f68fbc1c22eb4'/>
<id>urn:sha1:458fa742663f889033b87b6d866f68fbc1c22eb4</id>
<content type='text'>
The space flag is used to add a space before positive numbers, and
apostrophe is used to print the thousand separator. Add code to
ignore these two flags

Signed-off-by: Xiang W &lt;wxjstz@126.com&gt;
Reviewed-by: Anup Patel &lt;anup@brainfault.org&gt;
</content>
</entry>
<entry>
<title>lib: sbi: Add '+' flags for print</title>
<updated>2023-07-12T04:27:48Z</updated>
<author>
<name>Xiang W</name>
<email>wxjstz@126.com</email>
</author>
<published>2023-07-09T16:02:23Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/opensbi.git/commit/?id=40dac06e3c3c4056bf47d295c6fd85856556d998'/>
<id>urn:sha1:40dac06e3c3c4056bf47d295c6fd85856556d998</id>
<content type='text'>
Adds + flags for print, prefixing positive numbers with + when this
flags is present

Signed-off-by: Xiang W &lt;wxjstz@126.com&gt;
Reviewed-by: Anup Patel &lt;anup@brainfault.org&gt;
</content>
</entry>
</feed>
