Skip to content

Conversation

Siddd-hrr
Copy link

Made the errorcall() more informative to understand exactly where the things are going wrong during initialization of "times" attributes of rep() function .

@Siddd-hrr Siddd-hrr changed the title #18926 , improvement in error message for rep() function of R , #96 , improvement in error message for rep() function of R , Aug 4, 2025
src/main/seq.c Outdated
} else { // nt != 1
if(nt != (double) lx * each)
errorcall(call, _("invalid '%s' argument"), "times");
errorcall(call,_("invalid '%s' argument: length of time = %d, expected = %d from (length of x = %d , each = %d) "),"times",nt,(int)((double) lx * each),(int) lx , (int) each );
Copy link

@aitap aitap Aug 11, 2025

Choose a reason for hiding this comment

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

At least some of the variables being cast to (int) are of type R_xlen_t. Could they hold a number exceeding INT_MAX?

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