Host Engineering Forum

General Category => Do-more CPUs and Do-more Designer Software => Topic started by: fluidpowerman on December 18, 2013, 10:29:58 AM

Title: Do-more warning message
Post by: fluidpowerman on December 18, 2013, 10:29:58 AM
Not sure I structured this correctly,  I am getting a warning message.  Any suggestions is greatly appreciated!

Warning Messages - help
Buffer overflow - $BufferOverflow (ST140)
Attempted string operation was longer than target string and was truncated in STRGETB at main

STRGETB
Get out of String    SS0
start at index        0
Length of Bytes       32
Ingo Starting Element DLV1400-DLV1417

attached is the example of my code

Title: Re: Do-more warning message
Post by: BobO on December 18, 2013, 01:21:25 PM
It's just telling you that you read past the available data...you read 32 bytes, but the string wasn't 32 bytes long, so it only read up to the end of the string and not the full 32 bytes you asked for.
Title: Re: Do-more warning message
Post by: fluidpowerman on December 20, 2013, 12:42:44 PM
That makes sense,  so if I wanted to enter as a customer "Bryan Manning"  then I would have to know the string length and make that the number of bytes to get out of string.  but when the number of bytes will vary depending on the customer name then it get tricky.
Title: Re: Do-more warning message
Post by: plcnut on December 20, 2013, 12:55:42 PM
You can use a MOVE YourString1.length to D0,
and then use D0 for the 'Length in bytes' in your STRGETB instruction.
Title: Re: Do-more warning message
Post by: franji1 on December 20, 2013, 01:27:39 PM
You can use a MOVE YourString1.length to D0,
and then use D0 for the 'Length in bytes' in your STRGETB instruction.
Or simply use YourString1.Length as the length parameter  ;D
Title: Re: Do-more warning message
Post by: plcnut on December 20, 2013, 01:31:57 PM
You can use a MOVE YourString1.length to D0,
and then use D0 for the 'Length in bytes' in your STRGETB instruction.
Or simply use YourString1.Length as the length parameter  ;D
Ummm... Sounds to simple ;D