Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 336776 - "%$S" does not work in System_sprintf
Summary: "%$S" does not work in System_sprintf
Status: CLOSED FIXED
Alias: None
Product: RTSC
Classification: Technology
Component: Runtime (show other bugs)
Version: unspecified   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Sasha Slijepcevic CLA
QA Contact:
URL:
Whiteboard: target:3.20.09
Keywords:
Depends on: 336661
Blocks:
  Show dependency tree
 
Reported: 2011-02-09 19:58 EST by Sasha Slijepcevic CLA
Modified: 2011-10-25 17:46 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Sasha Slijepcevic CLA 2011-02-09 19:58:26 EST
This bug is opened for 3.20.09. The original bug 336661 is fixed in 3.21 and closed.

+++ This bug was initially created as a clone of Bug #336661 +++

I’m seeing a problem with System_sprintf. I have SysStd as the provider. When I try to use %$S, the printf works, but sprintf does not. Below is the output of the different test cases. Note: the sprintf cases’ output is the memory window for the string (in char and 8-bit signed decimal). I initialized the strings to all ‘4’s to make it easier to see…


System_printf("Test [%$S]\n", "ab<%d>cd", 10);

Output: Test [ab<10>cd]
 

System_sprintf(tempStr1, "Test [%$S]\n", "ab<%d>cd", 10);

tempStr1 char: Test.[]..10>cd.44

tempStr1 decimal: 84 101 115 116 32 91 93 10 0 49 48 62 99 100 0 52 52

                   T  e   s   t <sp> [ ]  lf \0 1  0 >  c   d  \0 4  4 

 

System_asprintf was the same as System_sprintf

I’ve tried this on 3.20.03.63 and 3.20.05.76.  The %$S is used in Log_error/warning/info calls. My new logger is using System_sprintf to help decode into a string and it is messed up for the Log_error/warning/info calls.
Comment 1 Sasha Slijepcevic CLA 2011-03-01 18:15:02 EST
Fixed in xdc-v57 in the same way bug 336661 was fixed.
Comment 2 Dave Russo CLA 2011-10-25 17:46:56 EDT
shipped in xdctools 3.20.09.90