Skip to content

Commit

Permalink
Correct text parameter example
Browse files Browse the repository at this point in the history
  • Loading branch information
j123b567 committed Aug 23, 2015
1 parent 8fbdbb1 commit 69bb4d3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions examples/common/scpi-def.c
Original file line number Diff line number Diff line change
Expand Up @@ -170,8 +170,8 @@ static scpi_result_t TEST_Text(scpi_t * context) {
char buffer[100];
size_t copy_len;

buffer[0] = 0;
SCPI_ParamCopyText(context, buffer, 100, &copy_len, FALSE);
SCPI_ParamCopyText(context, buffer, sizeof(buffer), &copy_len, FALSE);
buffer[copy_len] = '\0';

fprintf(stderr, "TEXT: ***%s***\r\n", buffer);

Expand Down
4 changes: 2 additions & 2 deletions examples/common/scpi-def.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -167,8 +167,8 @@ scpi_result_t TEST_Text(scpi_t * context) {
char buffer[100];
size_t copy_len;

buffer[0] = 0;
SCPI_ParamCopyText(context, buffer, 100, &copy_len, false);
SCPI_ParamCopyText(context, buffer, sizeof(buffer), &copy_len, false);
buffer[copy_len] = '\0';

fprintf(stderr, "TEXT: ***%s***\r\n", buffer);

Expand Down

0 comments on commit 69bb4d3

Please sign in to comment.