<feed xmlns='http://www.w3.org/2005/Atom'>
<title>u-boot.git/lib/vsprintf.c, branch v2014.04-rc3</title>
<subtitle>Unnamed repository; edit this file 'description' to name the repository.
</subtitle>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/'/>
<entry>
<title>lib: fix return codes when CONFIG_SYS_VSNPRINTF is enabled</title>
<updated>2014-01-24T21:59:07+00:00</updated>
<author>
<name>Darwin Rambo</name>
<email>drambo@broadcom.com</email>
</author>
<published>2013-12-19T23:14:19+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=686f60f519a3b06dfc4571cfb0dd832467179479'/>
<id>686f60f519a3b06dfc4571cfb0dd832467179479</id>
<content type='text'>
When CONFIG_SYS_VSNPRINTF is enabled, it protects print operations
such as sprintf, snprintf, vsnprintf, etc., from buffer overflows.
But vsnprintf_internal includes the terminating NULL character in
the calculation of number of characters written. This affects sprintf
and snprintf return values. Fix this issue by setting pointer 'str'
back to the location of the '\0'.

Signed-off-by: Darwin Rambo &lt;drambo@broadcom.com&gt;
Reviewed-by: Steve Rae &lt;srae@broadcom.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
When CONFIG_SYS_VSNPRINTF is enabled, it protects print operations
such as sprintf, snprintf, vsnprintf, etc., from buffer overflows.
But vsnprintf_internal includes the terminating NULL character in
the calculation of number of characters written. This affects sprintf
and snprintf return values. Fix this issue by setting pointer 'str'
back to the location of the '\0'.

Signed-off-by: Darwin Rambo &lt;drambo@broadcom.com&gt;
Reviewed-by: Steve Rae &lt;srae@broadcom.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Add function to print a number with grouped digits</title>
<updated>2013-06-26T14:16:41+00:00</updated>
<author>
<name>Simon Glass</name>
<email>sjg@chromium.org</email>
</author>
<published>2013-06-11T18:14:38+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=b8bcaa3ad393c34b7cdd9c8dcd9e9b82e2a34c58'/>
<id>b8bcaa3ad393c34b7cdd9c8dcd9e9b82e2a34c58</id>
<content type='text'>
Move bootstage's numbering printing code into a generic place so that it can
be used by tracing also.

Signed-off-by: Simon Glass &lt;sjg@chromium.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Move bootstage's numbering printing code into a generic place so that it can
be used by tracing also.

Signed-off-by: Simon Glass &lt;sjg@chromium.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>vsprintf: add ustrtoll function</title>
<updated>2013-02-19T22:01:26+00:00</updated>
<author>
<name>Piotr Wilczek</name>
<email>p.wilczek@samsung.com</email>
</author>
<published>2013-01-27T22:59:24+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=7df54d316e70e2d6ae080ef98aa9d2388bbb8af9'/>
<id>7df54d316e70e2d6ae080ef98aa9d2388bbb8af9</id>
<content type='text'>
Add 'ustrtoull' function to convert size from string (ex: 1GiB)
to unsigned long long type

Signed-off-by: Piotr Wilczek &lt;p.wilczek@samsung.com&gt;
Signed-off-by: Kyungmin Park &lt;kyungmin.park@samsung.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Add 'ustrtoull' function to convert size from string (ex: 1GiB)
to unsigned long long type

Signed-off-by: Piotr Wilczek &lt;p.wilczek@samsung.com&gt;
Signed-off-by: Kyungmin Park &lt;kyungmin.park@samsung.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>vsprintf:fix: Change type returned by ustrtoul</title>
<updated>2012-12-13T18:46:02+00:00</updated>
<author>
<name>Lukasz Majewski</name>
<email>l.majewski@samsung.com</email>
</author>
<published>2012-12-11T10:09:42+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=3ec44111aa33f568493f565285a3a519ef38e1dc'/>
<id>3ec44111aa33f568493f565285a3a519ef38e1dc</id>
<content type='text'>
The ustrtoul shall convert string defined size (e.g. 1GiB) to unsigned
long type (as its name implies).

Up till now it had returned int, which might cause problems with large
numbers (GiB range), when interpreted as U2 signed numbers.

Signed-off-by: Lukasz Majewski &lt;l.majewski@samsung.com&gt;
Signed-off-by: Kyungmin Park &lt;kyungmin.park@samsung.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The ustrtoul shall convert string defined size (e.g. 1GiB) to unsigned
long type (as its name implies).

Up till now it had returned int, which might cause problems with large
numbers (GiB range), when interpreted as U2 signed numbers.

Signed-off-by: Lukasz Majewski &lt;l.majewski@samsung.com&gt;
Signed-off-by: Kyungmin Park &lt;kyungmin.park@samsung.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>lib/vsprintf.c: sparse fixes</title>
<updated>2012-11-04T18:00:36+00:00</updated>
<author>
<name>Kim Phillips</name>
<email>kim.phillips@freescale.com</email>
</author>
<published>2012-10-29T13:34:36+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=0eb257683ded98431d6c30b360b7bd37235f518d'/>
<id>0eb257683ded98431d6c30b360b7bd37235f518d</id>
<content type='text'>
vsprintf.c:31:12: warning: symbol 'hex_asc' was not declared. Should it be static?
vsprintf.c:398:18: warning: Using plain integer as NULL pointer

Signed-off-by: Kim Phillips &lt;kim.phillips@freescale.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
vsprintf.c:31:12: warning: symbol 'hex_asc' was not declared. Should it be static?
vsprintf.c:398:18: warning: Using plain integer as NULL pointer

Signed-off-by: Kim Phillips &lt;kim.phillips@freescale.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>lib/vsprintf.c: don't special-case pointers to address null</title>
<updated>2012-11-02T22:13:29+00:00</updated>
<author>
<name>Wolfgang Denk</name>
<email>wd@denx.de</email>
</author>
<published>2012-10-30T09:19:52+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=d266f669252a5ebd7e9b940743ec7d05cdbd4061'/>
<id>d266f669252a5ebd7e9b940743ec7d05cdbd4061</id>
<content type='text'>
The %p format of printf() would print a pointer to address null as
"(null)".  This makes sense in a real OS where a NULL pointer must
never be dereferenced, but this is a bootloader, and there are cases
where accessing the data at address null makes perfect sense.

Remove the special case in lib/vsprintf.c using "#if 0" with a comment
to make clear this was an intentional change and to stop re-adding
this code.

Signed-off-by: Wolfgang Denk &lt;wd@denx.de&gt;
Acked-by: Joe Hershberger &lt;joe.hershberger@ni.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The %p format of printf() would print a pointer to address null as
"(null)".  This makes sense in a real OS where a NULL pointer must
never be dereferenced, but this is a bootloader, and there are cases
where accessing the data at address null makes perfect sense.

Remove the special case in lib/vsprintf.c using "#if 0" with a comment
to make clear this was an intentional change and to stop re-adding
this code.

Signed-off-by: Wolfgang Denk &lt;wd@denx.de&gt;
Acked-by: Joe Hershberger &lt;joe.hershberger@ni.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>lib: vsprintf.c: replace NUM_TYPE with s64/u64 types</title>
<updated>2012-10-15T18:53:46+00:00</updated>
<author>
<name>Daniel Schwierzeck</name>
<email>daniel.schwierzeck@gmail.com</email>
</author>
<published>2012-09-16T06:55:04+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=7b64f66c58944144ef6f616255fb0c7b3ae865f9'/>
<id>7b64f66c58944144ef6f616255fb0c7b3ae865f9</id>
<content type='text'>
This fixes warnings when compiling with ELDK-5.2.1 for MIPS64:

vsprintf.c: In function 'put_dec':
vsprintf.c:258:9: warning: comparison of distinct pointer types lacks a cast [enabled by default]
vsprintf.c:258:3: warning: passing argument 1 of '__div64_32' from incompatible pointer type [enabled by default]
include/div64.h:22:17: note: expected 'uint64_t *' but argument is of type 'long long unsigned int *'

Signed-off-by: Daniel Schwierzeck &lt;daniel.schwierzeck@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This fixes warnings when compiling with ELDK-5.2.1 for MIPS64:

vsprintf.c: In function 'put_dec':
vsprintf.c:258:9: warning: comparison of distinct pointer types lacks a cast [enabled by default]
vsprintf.c:258:3: warning: passing argument 1 of '__div64_32' from incompatible pointer type [enabled by default]
include/div64.h:22:17: note: expected 'uint64_t *' but argument is of type 'long long unsigned int *'

Signed-off-by: Daniel Schwierzeck &lt;daniel.schwierzeck@gmail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>lib: vsprintf.c: fix checkpath.pl warnings</title>
<updated>2012-10-15T18:53:46+00:00</updated>
<author>
<name>Daniel Schwierzeck</name>
<email>daniel.schwierzeck@gmail.com</email>
</author>
<published>2012-09-16T06:55:03+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=8acdae681a61d05ef2d93b3c51a20a5257afb610'/>
<id>8acdae681a61d05ef2d93b3c51a20a5257afb610</id>
<content type='text'>
Signed-off-by: Daniel Schwierzeck &lt;daniel.schwierzeck@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Signed-off-by: Daniel Schwierzeck &lt;daniel.schwierzeck@gmail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>vsprintf: Move function documentation into header file</title>
<updated>2011-12-17T22:34:01+00:00</updated>
<author>
<name>Simon Glass</name>
<email>sjg@chromium.org</email>
</author>
<published>2011-11-02T09:52:09+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=71ec92b67c1983a87a8c405d280e2dba1cc0080d'/>
<id>71ec92b67c1983a87a8c405d280e2dba1cc0080d</id>
<content type='text'>
Now that this is not in common.h, perhaps it is acceptable to move this
documentation into the header file.

Signed-off-by: Simon Glass &lt;sjg@chromium.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Now that this is not in common.h, perhaps it is acceptable to move this
documentation into the header file.

Signed-off-by: Simon Glass &lt;sjg@chromium.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Add safe vsnprintf and snprintf library functions</title>
<updated>2011-12-17T22:33:20+00:00</updated>
<author>
<name>Sonny Rao</name>
<email>sonnyrao@chromium.org</email>
</author>
<published>2011-11-02T09:52:08+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=046a37bd53f479915bcd5041e0834dad576371a2'/>
<id>046a37bd53f479915bcd5041e0834dad576371a2</id>
<content type='text'>
From: Sonny Rao &lt;sonnyrao@chromium.org&gt;

These functions are useful in U-Boot because they allow a graceful failure
rather than an unpredictable stack overflow when printf() buffers are
exceeded.

Mostly copied from the Linux kernel. I copied vscnprintf and
scnprintf so we can change printf and vprintf to use the safe
implementation but still return the correct values.

(Simon Glass &lt;sjg@chromium.org&gt; modified this commit a little)

Signed-off-by: Sonny Rao &lt;sonnyrao@chromium.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
From: Sonny Rao &lt;sonnyrao@chromium.org&gt;

These functions are useful in U-Boot because they allow a graceful failure
rather than an unpredictable stack overflow when printf() buffers are
exceeded.

Mostly copied from the Linux kernel. I copied vscnprintf and
scnprintf so we can change printf and vprintf to use the safe
implementation but still return the correct values.

(Simon Glass &lt;sjg@chromium.org&gt; modified this commit a little)

Signed-off-by: Sonny Rao &lt;sonnyrao@chromium.org&gt;
</pre>
</div>
</content>
</entry>
</feed>
