diff options
author | jaseg <code@jaseg.net> | 2014-10-26 13:31:39 +0100 |
---|---|---|
committer | jaseg <code@jaseg.net> | 2014-10-26 13:31:39 +0100 |
commit | 5bd8c7dccaf04939fc8aa8b9a9aecdb56f2b9b91 (patch) | |
tree | 69bcd5076815dfb41c3ef98173d176f7e9c52e87 /lolcat.c | |
parent | dd087f64ee61f0d2e6d42c5b853ba0fa3f5ad492 (diff) | |
download | lolcat-5bd8c7dccaf04939fc8aa8b9a9aecdb56f2b9b91.tar.gz lolcat-5bd8c7dccaf04939fc8aa8b9a9aecdb56f2b9b91.tar.bz2 lolcat-5bd8c7dccaf04939fc8aa8b9a9aecdb56f2b9b91.zip |
Fixed mulit-column character handling
Diffstat (limited to 'lolcat.c')
-rw-r--r-- | lolcat.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -147,8 +147,8 @@ int main(int argc, char **argv){ if(c == '\n'){ l++; i = 0; - }else if(!iscntrl(c)){ - int ncc = offx*ARRAY_SIZE(codes) + (int)((i++)*freq_h + l*freq_v); + }else{ + int ncc = offx*ARRAY_SIZE(codes) + (int)((i+=wcwidth(c))*freq_h + l*freq_v); if(cc != ncc) printf("\033[38;5;%hhum", codes[(cc = ncc) % ARRAY_SIZE(codes)]); } |