History

move stuff around and just use Biobuf* everywhere

Sigrid Haflínudóttir committed 6 years ago

Commit ecd40a81 parent 745debc8 files · +82 −64Browse files

Showing the changes to string.c (1 of 8 files). Show all

Unified · Split

string.c+6−6
@@ -62,7 +62,7 @@ pdfstring(Biobuf *b) · 61 unmodified lines
6262 return nil;
6363
6464 for(paren = sz = 0;;){
65− if((c = Bgetc(b)) <= 0)
65+ if((c = Bgetc(b)) < 0)
6666 break;
6767
6868 switch(c){
@@ -81,7 +81,7 @@ pdfstring(Biobuf *b) · 12 unmodified lines
8181 paren--;
8282 if(paren < 1){
8383 c = 0;
84− break;
84+ goto end;
8585 }
8686 continue;
8787
@@ -99,7 +99,7 @@ pdfstring(Biobuf *b) · 11 unmodified lines
9999 oct[i] = 0;
100100 c = strtol(oct, nil, 8);
101101 }else if(c >= nelem(esc) || (c = esc[c]) == 0){
102− werrstr("unknown escape char %c", c);
102+ werrstr("unknown escape char '%c'", c);
103103 goto err;
104104 }else if(c < 0){
105105 continue;
@@ -108,13 +108,13 @@ pdfstring(Biobuf *b) · 2 unmodified lines
108108
109109 default:
110110 if(paren < 1){
111− werrstr("unexpected char '%c'", c);
111+ werrstr("unexpected char %02x '%c'", (u8int)c, c);
112112 goto err;
113113 }
114114 break;
115115 }
116116
117− if(c <= 0)
117+ if(c < 0)
118118 break;
119119 if(sz+1 > maxsz){
120120 maxsz *= 2;
@@ -124,7 +124,7 @@ pdfstring(Biobuf *b) · 3 unmodified lines
124124 }
125125 s[sz++] = c;
126126 }
127−
127+end:
128128 if(paren != 0){
129129 werrstr("bad paren");
130130 goto err;

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t