Skip to content

dbwritetext: Fail if dbconvert does.#577

Closed
ucko wants to merge 1 commit into
FreeTDS:masterfrom
ucko:ncbi-2024-05-dbwritetext-require-dbconvert
Closed

dbwritetext: Fail if dbconvert does.#577
ucko wants to merge 1 commit into
FreeTDS:masterfrom
ucko:ncbi-2024-05-dbwritetext-require-dbconvert

Conversation

@ucko
Copy link
Copy Markdown
Contributor

@ucko ucko commented May 30, 2024

Split from #555.

Signed-off-by: Aaron M. Ucko <ucko@ncbi.nlm.nih.gov>
Comment thread src/dblib/dblib.c
Comment on lines +6656 to +6663
len = dbconvert(dbproc, SYBBINARY, (BYTE *) textptr, textptrlen,
SYBCHAR, (BYTE *) textptr_string, -1);
if (len < 0)
return FAIL;
len = dbconvert(dbproc, SYBBINARY, (BYTE *) timestamp, 8, SYBCHAR,
(BYTE *) timestamp_string, -1);
if (len < 0)
return FAIL;
Copy link
Copy Markdown
Contributor

@freddy77 freddy77 May 30, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But this function cannot fail with these arguments!

@ucko
Copy link
Copy Markdown
Contributor Author

ucko commented May 31, 2024

Good point. These checks come from a former colleague who left years ago; I'm unclear on why he added them.

@ucko ucko closed this May 31, 2024
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.

2 participants