Timeline for GDB Error "Too many array elements"
Current License: CC BY-SA 3.0
12 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Jun 9, 2013 at 17:05 | comment | added | Noé Malzieu | That makes perfect sense | |
Jun 9, 2013 at 16:47 | comment | added | dna |
You are free to fill a 512 chars buffer with 512 chars. But in GDB when using the command set buffer="A" you are filling it with a string, thus with a final null byte terminator.
|
|
Jun 9, 2013 at 16:34 | vote | accept | Noé Malzieu | ||
Jun 9, 2013 at 16:34 | comment | added | Noé Malzieu |
Ok thanks a lot! Last question: does that mean that in C, if I create char buffer[512]; , I can only fill it with 511 chars as well?
|
|
Jun 9, 2013 at 16:28 | history | edited | dna | CC BY-SA 3.0 |
edited body
|
Jun 9, 2013 at 16:28 | comment | added | dna | Oh sorry that was a typo. Yes of course the last character has to be a null byte, moreover GDB tried to append it for you. Given the array definition this is why writing 511 "a" worked but not 512. | |
Jun 9, 2013 at 16:22 | comment | added | Noé Malzieu |
Thanks, but I wasn't trying to write in 513 A but only 512... Or is it that the last character has to be a \x00 ?
|
|
Jun 9, 2013 at 13:56 | history | edited | dna | CC BY-SA 3.0 |
added 11 characters in body
|
Jun 9, 2013 at 12:59 | history | edited | dna | CC BY-SA 3.0 |
deleted 7 characters in body
|
Jun 9, 2013 at 11:06 | history | edited | dna | CC BY-SA 3.0 |
added 51 characters in body
|
Jun 9, 2013 at 9:43 | review | First posts | |||
Jun 10, 2013 at 13:45 | |||||
Jun 9, 2013 at 9:25 | history | answered | dna | CC BY-SA 3.0 |