if you use 512 you could overflow your var and overwrite other memory and cause a fun crash. It really has nothing to do with "getting" the position. That arg is setting the max length to copy into the var. So if you start at pos 0 (which is correct) and the var is len 512 you should copy a max of 511 (511 - 0).