Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace char pointer with char array in samples. #108

Merged
merged 1 commit into from
Jul 30, 2024

Conversation

ActoryOu
Copy link
Member

@ActoryOu ActoryOu commented Jul 30, 2024

Issue #, if available:
#107

Description of changes:
The sample codes for Jobs_StartNextMsg() and Jobs_UpdateMsg() in jobs.h is wrong. Replace the char pointer with char array to calculate the length correctly.


For example, before changing:

const char * statusDetails = "{\"key\":\"value\"}";
/* ... */
request.statusDetailsLength = ( sizeof( statusDetails ) - 1U );

In this case, sizeof( statusDetails ) returns the size of pointer, which is 4 or 8, instead of the length.


After changing:

const char statusDetails[] = "{\"key\":\"value\"}";
/* ... */
request.statusDetailsLength = ( sizeof( statusDetails ) - 1U );

In this case, sizeof( statusDetails ) returns the size of array, which is 15.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@aggarg aggarg merged commit 4b4d440 into aws:main Jul 30, 2024
10 checks passed
@ActoryOu ActoryOu deleted the updateMsgComments branch July 30, 2024 15:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants