@@ -101,31 +101,33 @@ void CNAME( enum CBLAS_ORDER CORDER, enum CBLAS_TRANSPOSE CTRANS, blasint crows,
101101
102102 if ( order == BlasColMajor )
103103 {
104- if ( trans == BlasNoTrans && * ldb < * rows ) info = 9 ;
105- if ( trans == BlasConj && * ldb < * rows ) info = 9 ;
106- if ( trans == BlasTrans && * ldb < * cols ) info = 9 ;
107- if ( trans == BlasTransConj && * ldb < * cols ) info = 9 ;
104+ if ( trans == BlasNoTrans && * ldb < MAX ( 1 , * rows ) ) info = 9 ;
105+ if ( trans == BlasConj && * ldb < MAX ( 1 , * rows ) ) info = 9 ;
106+ if ( trans == BlasTrans && * ldb < MAX ( 1 , * cols ) ) info = 9 ;
107+ if ( trans == BlasTransConj && * ldb < MAX ( 1 , * cols ) ) info = 9 ;
108108 }
109109 if ( order == BlasRowMajor )
110110 {
111- if ( trans == BlasNoTrans && * ldb < * cols ) info = 9 ;
112- if ( trans == BlasConj && * ldb < * cols ) info = 9 ;
113- if ( trans == BlasTrans && * ldb < * rows ) info = 9 ;
114- if ( trans == BlasTransConj && * ldb < * rows ) info = 9 ;
111+ if ( trans == BlasNoTrans && * ldb < MAX ( 1 , * cols ) ) info = 9 ;
112+ if ( trans == BlasConj && * ldb < MAX ( 1 , * cols ) ) info = 9 ;
113+ if ( trans == BlasTrans && * ldb < MAX ( 1 , * rows ) ) info = 9 ;
114+ if ( trans == BlasTransConj && * ldb < MAX ( 1 , * rows ) ) info = 9 ;
115115 }
116116
117- if ( order == BlasColMajor && * lda < * rows ) info = 7 ;
118- if ( order == BlasRowMajor && * lda < * cols ) info = 7 ;
119- if ( * cols <= 0 ) info = 4 ;
120- if ( * rows <= 0 ) info = 3 ;
121- if ( trans < 0 ) info = 2 ;
122- if ( order < 0 ) info = 1 ;
117+ if ( order == BlasColMajor && * lda < MAX ( 1 , * rows ) ) info = 7 ;
118+ if ( order == BlasRowMajor && * lda < MAX ( 1 , * cols ) ) info = 7 ;
119+ if ( * cols < 0 ) info = 4 ;
120+ if ( * rows < 0 ) info = 3 ;
121+ if ( trans < 0 ) info = 2 ;
122+ if ( order < 0 ) info = 1 ;
123123
124124 if (info >= 0 ) {
125125 BLASFUNC (xerbla )(ERROR_NAME , & info , sizeof (ERROR_NAME ));
126126 return ;
127127 }
128128
129+ if ((* rows == 0 ) || (* cols == 0 )) return ;
130+
129131#ifdef NEW_IMATCOPY
130132 if (* lda == * ldb ) {
131133 if ( order == BlasColMajor )
0 commit comments