Fossil SCM

minor buffer length fix for the previous change

stephan 2008-02-08 22:02 trunk
Commit 091499ec1a4002f7e2860c5b10fb5628a3f8be39
1 file changed +3 -3
+3 -3
--- src/zip.c
+++ src/zip.c
@@ -304,23 +304,23 @@
304304
** buffer for the prefix + current file name. zHead keeps track
305305
** of where we should write file names to this buffer.
306306
*/
307307
if( manifest_parse(&m, &mfile) ){
308308
zip_set_timedate(m.rDate);
309
- snprintf( zHead, bufsize, "manifest" );
309
+ snprintf( zHead, bufsize-prxLen, "manifest" );
310310
zip_add_file(aSBuf, &file);
311311
sha1sum_blob(&file, &hash);
312312
blob_reset(&file);
313313
blob_append(&hash, "\n", 1);
314
- snprintf( zHead, bufsize, "manifest.uuid" );
314
+ snprintf( zHead, bufsize-prxLen, "manifest.uuid" );
315315
zip_add_file(aSBuf, &hash);
316316
blob_reset(&hash);
317317
for(i=0; i<m.nFile; i++){
318318
int fid = uuid_to_rid(m.aFile[i].zUuid, 0);
319319
if( fid ){
320320
content_get(fid, &file);
321
- snprintf( zHead, bufsize, "%s", m.aFile[i].zName );
321
+ snprintf( zHead, bufsize-prxLen, "%s", m.aFile[i].zName );
322322
zip_add_file( aSBuf, &file);
323323
blob_reset(&file);
324324
}
325325
}
326326
manifest_clear(&m);
327327
--- src/zip.c
+++ src/zip.c
@@ -304,23 +304,23 @@
304 ** buffer for the prefix + current file name. zHead keeps track
305 ** of where we should write file names to this buffer.
306 */
307 if( manifest_parse(&m, &mfile) ){
308 zip_set_timedate(m.rDate);
309 snprintf( zHead, bufsize, "manifest" );
310 zip_add_file(aSBuf, &file);
311 sha1sum_blob(&file, &hash);
312 blob_reset(&file);
313 blob_append(&hash, "\n", 1);
314 snprintf( zHead, bufsize, "manifest.uuid" );
315 zip_add_file(aSBuf, &hash);
316 blob_reset(&hash);
317 for(i=0; i<m.nFile; i++){
318 int fid = uuid_to_rid(m.aFile[i].zUuid, 0);
319 if( fid ){
320 content_get(fid, &file);
321 snprintf( zHead, bufsize, "%s", m.aFile[i].zName );
322 zip_add_file( aSBuf, &file);
323 blob_reset(&file);
324 }
325 }
326 manifest_clear(&m);
327
--- src/zip.c
+++ src/zip.c
@@ -304,23 +304,23 @@
304 ** buffer for the prefix + current file name. zHead keeps track
305 ** of where we should write file names to this buffer.
306 */
307 if( manifest_parse(&m, &mfile) ){
308 zip_set_timedate(m.rDate);
309 snprintf( zHead, bufsize-prxLen, "manifest" );
310 zip_add_file(aSBuf, &file);
311 sha1sum_blob(&file, &hash);
312 blob_reset(&file);
313 blob_append(&hash, "\n", 1);
314 snprintf( zHead, bufsize-prxLen, "manifest.uuid" );
315 zip_add_file(aSBuf, &hash);
316 blob_reset(&hash);
317 for(i=0; i<m.nFile; i++){
318 int fid = uuid_to_rid(m.aFile[i].zUuid, 0);
319 if( fid ){
320 content_get(fid, &file);
321 snprintf( zHead, bufsize-prxLen, "%s", m.aFile[i].zName );
322 zip_add_file( aSBuf, &file);
323 blob_reset(&file);
324 }
325 }
326 manifest_clear(&m);
327

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button