summaryrefslogtreecommitdiff
path: root/lolcat.c
diff options
context:
space:
mode:
Diffstat (limited to 'lolcat.c')
-rw-r--r--lolcat.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/lolcat.c b/lolcat.c
index 496016c..5c4b687 100644
--- a/lolcat.c
+++ b/lolcat.c
@@ -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)]);
}