[brlcad-tracker] [ brlcad-Bugs-3475562 ] bu_vls_printf doesn't handle complex formats properly
Open Source Solid Modeling CAD
Brought to you by:
brlcad
From: SourceForge.net <no...@so...> - 2012-01-19 13:08:15
|
Bugs item #3475562, was opened at 2012-01-18 08:15 Message generated for change (Comment added) made by tbrowder2 You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=640802&aid=3475562&group_id=105292 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: None Group: None Status: Open Resolution: None Priority: 5 Private: No Submitted By: Tom Browder (tbrowder2) Assigned to: Nobody/Anonymous (nobody) Summary: bu_vls_printf doesn't handle complex formats properly Initial Comment: This was fixed for a simple case in bug no. 3163487, but this format string doesn't work: bu_vls_printf(gedp->ged_result_str, "%-*.*s| %-*.*s = %*.*s |\n", indent, indent, " ", maxwidth[0], maxwidth[0], fname.rows[i].fields[0].buf, maxwidth[1], maxwidth[1], table->rows[i].fields[0].buf); The result works for the first and second '%*.*s' fields but the last field width is ignored (with or without the '-'). I can work around it by building the string with sprintf and feeding that to bu_vls_printf. I'll add a test case later today. ---------------------------------------------------------------------- >Comment By: Tom Browder (tbrowder2) Date: 2012-01-19 05:08 Message: The bug actually exists with a simpler format string as may be seen in the attached test case. It seems that right justification in a wider-than-strlen field doesn't work in second or later fields. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=640802&aid=3475562&group_id=105292 |