On May 23, 2012, at 00:39, Gerhard Postpischil wrote:

> On 5/22/2012 10:45 PM, Tony Thigpen wrote:
>> get strange errors. On the other hand, move a short field to a
>> longer
>> field and we also get errors when we throw garbage into our
>> data.
>
> I think you're missing the point. The second field being shorter
> is exactly the case when MVC2/MVC:2 is needed to avoid garbage
> in the output. I blank a print line, then move text (e.g., error
> explanation) into one or more comments fields. With the current
> MVC, it's all too easy to get garbage after the desired text.
> I've also seen horrors where all possible error texts have an
> explicit length, wasting more storage than needed.
>
So, I wonder:  If I code:

    MVC X+OFFSET,=C'string'

is the implied length as:


    MVC X+OFFSET(L'X),=C'string'

or:

    MVC X+OFFSET(L'X-OFFSET),=C'string'

(or other)?  There's some intuitive argument for the latter,
but I suspect that's not what happens.


On May 22, 2012, at 10:01, Webster, Chris wrote:
>
> strncpy() should be preferred to strcpy() in many instances.
>
strncpy() has the sometimes undesirable behavior of padding
the source with nulls to match the length specified.

> It is more common to map the layout.
>
That works poorly when the operands have different
lengths.  If I want to move C'.' to the end of a sentence,
I don't wamt to pad all my sentences with blanks to equal
lengths.

-- gil

Reply via email to