Re: [dev] sbase - seq.c: help wanted

From: Christoph Lohmann <20h_AT_r-36.net>
Date: Mon, 16 Apr 2012 14:40:01 +0200

Greetings.

On Mon, 16 Apr 2012 14:40:01 +0200 "Galos, David" <galosd83_AT_students.rowan.edu> wrote:
> > Attached is a first shot at seq(1) for sbase.  I do not like having to
> > juggle data around to play games with sprintf, so if someone has a
> > cleaner approach to this program, please speak up.
>
> Unfortunately, there isn't much that can be done. User input is always
> sub-par, and unless we want to account for scientific notation, or trailing
> zeros, the easiest thing is to let atof parse the input, and then have
> sprintf provide us a sane string.
>
> I've cleaned up the code a bit, moved the digit-counting into separate
> functions, and added simple regexp.h format string validation. I realizr

I’m sorry to not having answered. There is now a modified seq in sbase +
manpage[0]. It is based on the seq.c of Kurt but resembles much closer
the format difficulties. For example doing atof() on the arguments won’t
preserve the aligned width in »60.000«.

Have you tried the fmtvalid() function? It seems like there is a typo
where it is used. Such a function would still be useful in the now ex‐
isting seq.c.


Sincerely,

Christoph Lohmann

[0] http://hg.suckless.org/sbase/file/0a27ae20602a/seq.c
Received on Mon Apr 16 2012 - 14:40:01 CEST

This archive was generated by hypermail 2.3.0 : Mon Apr 16 2012 - 14:48:05 CEST