We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f7578ae commit b5b3b2dCopy full SHA for b5b3b2d
src/library/grid/src/unit.c
@@ -1,7 +1,7 @@
1
/*
2
* R : A Computer Language for Statistical Data Analysis
3
* Copyright (C) 2001-3 Paul Murrell
4
- * 2003-2020 The R Core Team
+ * 2003-2024 The R Core Team
5
*
6
* This program is free software; you can redistribute it and/or modify
7
* it under the terms of the GNU General Public License as published by
@@ -1949,7 +1949,7 @@ SEXP summaryUnits(SEXP units, SEXP op_type) {
1949
SET_STRING_ELT(cl, 0, mkChar("unit"));
1950
SET_STRING_ELT(cl, 1, mkChar("unit_v2"));
1951
1952
- int is_type[m];
+ int is_type[m > 0 ? m : 1L]; // mmight be zero which would not be legal C.
1953
int all_type = 1;
1954
1955
for (int i = 0; i < n; i++) {
0 commit comments