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
-
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
-
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.
-
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.
-
You can use a MOVE YourString1.length to D0,
and then use D0 for the 'Length in bytes' in your STRGETB instruction.
-
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
-
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