From 5a291606adaf425f34dc7223a7775b93518c08cf Mon Sep 17 00:00:00 2001 From: Zhang Xianyi Date: Sat, 24 Oct 2015 01:16:34 +0800 Subject: [PATCH] Refs #671. the return of i?max cannot larger than N. --- interface/imax.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/interface/imax.c b/interface/imax.c index 55ffa7c6e..4378f1e22 100644 --- a/interface/imax.c +++ b/interface/imax.c @@ -136,6 +136,8 @@ blasint NAME(blasint *N, FLOAT *x, blasint *INCX){ ret = (blasint)MAX_K(n, x, incx); + if(ret > n) ret=n; + FUNCTION_PROFILE_END(COMPSIZE, n, 0); IDEBUG_END; @@ -159,6 +161,8 @@ CBLAS_INDEX CNAME(blasint n, FLOAT *x, blasint incx){ ret = MAX_K(n, x, incx); + if (ret > n) ret=n; + if (ret) ret --; FUNCTION_PROFILE_END(COMPSIZE, n, 0);