Skip to content

[#723] Require at least one digit in pgexporter_is_number() - #724

Open
hardikkaurani wants to merge 1 commit into
pgexporter:mainfrom
hardikkaurani:fix/is-number-require-digit
Open

hardikkaurani wants to merge 1 commit into
pgexporter:mainfrom
hardikkaurani:fix/is-number-require-digit

Conversation

@hardikkaurani

Copy link
Copy Markdown
Contributor

Fixes #723

Summary

  • Track has_digit in pgexporter_is_number() (src/libpgexporter/utils.c) so strings containing only \r or \n (with no digits) return false instead of true.
  • Added test_is_number in test/testcases/test_utils.c covering NULL, empty strings, \n / \r\n alone, valid base-10/base-16 numbers with trailing newlines, and invalid base-10 hex digits.

Copilot AI balanced review requested due to automatic review settings December 1, 2026 08:40

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

@hardikkaurani

Copy link
Copy Markdown
Contributor Author

@jesperpedersen @Pranav-error Ready for review! This fixes #723 by tracking has_digit in pgexporter_is_number() (src/libpgexporter/utils.c) so strings with only \r/\n return false, and adds test_is_number in test/testcases/test_utils.c.

@Pranav-error

Copy link
Copy Markdown
Collaborator

#692 is merged now. It fixes the Debug crash in test_connection_bind_unix_socket_permissions (#691), which is what fails both build-linux Debug jobs here. Please rebase on main.

@hardikkaurani
hardikkaurani force-pushed the fix/is-number-require-digit branch from 45866fd to a065b65 Compare December 2, 2026 21:28
@hardikkaurani

Copy link
Copy Markdown
Contributor Author

@Pranav-error Rebased onto main (a065b65) to pick up #692.

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.

pgexporter_is_number() returns true for strings with only \\r or \\n

3 participants