# HG changeset patch # User Philip Nienhuis # Date 1312900930 25200 # Node ID 3509cf60d1f690444f418fa30ab590376dd35668 # Parent 9f2679a1436686171d1facd918acf83d0347c31d strread.m: %Ns conversion format now honors user specified width (Bug #33950). * strread.m: Fix typo in code which fixed width at 3, regardless of user input. diff --git a/scripts/io/strread.m b/scripts/io/strread.m --- a/scripts/io/strread.m +++ b/scripts/io/strread.m @@ -471,7 +471,7 @@ endif endfor ## Done - words_period = iwrd - 1; + words_period = max (iwrd - 1, 1); num_lines = ceil (num_words / words_period); ## 2. Pad words array so that it can be reshaped @@ -633,7 +633,7 @@ if (pad_out) data(end+1:num_lines) = {""} endif - varargout{k} = strtrunc (data, 3)'; + varargout{k} = strtrunc (data, swidth)'; k++; otherwise endswitch