diff --git a/Eigen/src/Core/IO.h b/Eigen/src/Core/IO.h index ca5f247ed..0a1b583d6 100644 --- a/Eigen/src/Core/IO.h +++ b/Eigen/src/Core/IO.h @@ -68,8 +68,8 @@ struct IOFormat { // TODO check if rowPrefix, rowSuffix or rowSeparator contains a newline // don't add rowSpacer if columns are not to be aligned if ((flags & DontAlignCols)) return; - int i = int(matSuffix.length()) - 1; - while (i >= 0 && matSuffix[i] != '\n') { + int i = int(matPrefix.length()) - 1; + while (i >= 0 && matPrefix[i] != '\n') { rowSpacer += ' '; i--; }