Re: Problem with strlen and string containing color code s

From: Chuck Carson (ccarson@phi.org)
Date: 08/27/99


Let me show where I am unsig this first:

I have redone list_object in shop.c to
support some new obj fields. I am
using sprintf(buf, "%-50s", obj->short_desc...)
to print the short descrition. The escape
codes are being confused and the lines containing
color codes aqre not taking up the 50 spaces,
thus the next column (cost) is not justified
all the way down the listing. I could strip
color but I do not really want to do that.

An accurate strlen cannot help me unless I
am missing something? I already played with
counting the length of each string and then
using a for loop to print " "'s but that is
ugly and a wast of cycles.

Any ideas?
Chuck

     +------------------------------------------------------------+
     | Ensure that you have read the CircleMUD Mailing List FAQ:  |
     |  http://qsilver.queensu.ca/~fletchra/Circle/list-faq.html  |
     +------------------------------------------------------------+



This archive was generated by hypermail 2b30 : 12/15/00 PST