Skip to content

Commit 5a29160

Browse files
committed
Refs #671. the return of i?max cannot larger than N.
1 parent 1ce054f commit 5a29160

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

interface/imax.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,8 @@ blasint NAME(blasint *N, FLOAT *x, blasint *INCX){
136136

137137
ret = (blasint)MAX_K(n, x, incx);
138138

139+
if(ret > n) ret=n;
140+
139141
FUNCTION_PROFILE_END(COMPSIZE, n, 0);
140142

141143
IDEBUG_END;
@@ -159,6 +161,8 @@ CBLAS_INDEX CNAME(blasint n, FLOAT *x, blasint incx){
159161

160162
ret = MAX_K(n, x, incx);
161163

164+
if (ret > n) ret=n;
165+
162166
if (ret) ret --;
163167

164168
FUNCTION_PROFILE_END(COMPSIZE, n, 0);

0 commit comments

Comments
 (0)