Skip to content

Instantly share code, notes, and snippets.

@eqdw
Created February 9, 2023 03:53
Show Gist options
  • Save eqdw/9d09c89c6a6edbd8f56df32f96019e0d to your computer and use it in GitHub Desktop.
Save eqdw/9d09c89c6a6edbd8f56df32f96019e0d to your computer and use it in GitHub Desktop.
while(s->string[i] != '\0') {
newStringData[i] = s->string[i];
i++;
}
//strcpy(newStringData, s->string);
// copy over the null terminator + the checksum value
for(int j=0;j<5;j++){
newStringData[i+j] = s->string[i+j];
}
// replace the above with
while(i < len + 5) {
newStringData[i] = s->string[i];
i++;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment