comparison src/c/urweb.c @ 1429:eecbffc2b907

Fix C jsify[String|Char]
author Adam Chlipala <adam@chlipala.net>
date Fri, 25 Feb 2011 15:58:08 -0500
parents 22674ac8ebe6
children 4a6f84092399
comparison
equal deleted inserted replaced
1428:58c9c039582a 1429:eecbffc2b907
1366 break; 1366 break;
1367 default: 1367 default:
1368 if (isprint((int)c) || c >= 128) 1368 if (isprint((int)c) || c >= 128)
1369 *s2++ = c; 1369 *s2++ = c;
1370 else { 1370 else {
1371 sprintf(s2, "\\%3o", c); 1371 sprintf(s2, "\\%03o", c);
1372 s2 += 4; 1372 s2 += 4;
1373 } 1373 }
1374 } 1374 }
1375 } 1375 }
1376 1376
1403 break; 1403 break;
1404 default: 1404 default:
1405 if (isprint((int)c) || c >= 128) 1405 if (isprint((int)c) || c >= 128)
1406 *s2++ = c; 1406 *s2++ = c;
1407 else { 1407 else {
1408 sprintf(s2, "\\%3o", (unsigned char)c); 1408 sprintf(s2, "\\%03o", (unsigned char)c);
1409 s2 += 4; 1409 s2 += 4;
1410 } 1410 }
1411 } 1411 }
1412 1412
1413 strcpy(s2, "\""); 1413 strcpy(s2, "\"");
1437 break; 1437 break;
1438 default: 1438 default:
1439 if (isprint((int)c) || c >= 128) 1439 if (isprint((int)c) || c >= 128)
1440 *s2++ = c; 1440 *s2++ = c;
1441 else { 1441 else {
1442 sprintf(s2, "\\%3o", c); 1442 sprintf(s2, "\\%03o", c);
1443 s2 += 4; 1443 s2 += 4;
1444 } 1444 }
1445 } 1445 }
1446 } 1446 }
1447 1447