sixel 0.1.2.0 → 0.1.2.1
raw patch · 3 files changed
+27/−9 lines, 3 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
Files
- CHANGELOG.md +4/−0
- csrc/sixel.c +22/−8
- sixel.cabal +1/−1
CHANGELOG.md view
@@ -7,3 +7,7 @@ ## 0.1.2.0 -- 2020-05-19 * Support for Latex++## 0.1.2.1 -- 2020-05-20++* Fix overflow of parsing number
csrc/sixel.c view
@@ -1,17 +1,31 @@+#include <string.h>+#include <stdio.h>+ int bufsize(int width,int height){ return 256+((5+3*3+2+1)*width + 1)*height; } void putnum(unsigned char* buf,int* p, unsigned int r) {- int v100 = (r)/100;- int v10 = ((r)%100)/10;- int v1 = (r)%10;- if(v100)- buf[(*p)++] = '0' + v100;- if(v100 || v10)- buf[(*p)++] = '0' + v10;- buf[(*p)++] = '0' + v1;+ if(r >= 1000) {+ unsigned char sbuf[32];+ int len;+ int i;+ sprintf(sbuf,"%d",r);+ len=strlen(sbuf);+ for(i=0;i<len;i++){+ buf[(*p)++] = sbuf[i];+ }+ } else {+ int v100 = (r)/100;+ int v10 = ((r)%100)/10;+ int v1 = (r)%10;+ if(v100)+ buf[(*p)++] = '0' + v100;+ if(v100 || v10)+ buf[(*p)++] = '0' + v10;+ buf[(*p)++] = '0' + v1;+ } } int
sixel.cabal view
@@ -1,6 +1,6 @@ cabal-version: >=1.10 name: sixel-version: 0.1.2.0+version: 0.1.2.1 synopsis: Sixel library to show images in a terminal emulator description: Sixel can show graphics on a terminal emulator. This library is developed to showing images on ghci. license: BSD3