replacement in change.c at line 273
[4.2731]→[4.2731:2771](∅→∅) − local->path = bincode_getstr(bc, len);
+ local->path = xmalloc(len + 1);
+ bincode_getstr(bc, local->path, len);
replacement in change.c at line 284
[4.2931]→[4.2931:2970](∅→∅) − *encoding = bincode_getstr(bc, len);
+ *encoding = xmalloc(len + 1);
+ bincode_getstr(bc, *encoding, len);
replacement in change.c at line 326
[4.3683]→[4.3683:3734](∅→∅) − bhunk->fileadd.path = bincode_getstr(bc, slen);
+ bhunk->fileadd.path = xmalloc(slen + 1);
+ bincode_getstr(bc, bhunk->fileadd.path, slen);
replacement in change.c at line 334
[4.3920]→[4.3920:3972](∅→∅) − bhunk->filemove.path = bincode_getstr(bc, slen);
+ bhunk->filemove.path = xmalloc(slen + 1);
+ bincode_getstr(bc, bhunk->filemove.path, slen);
replacement in change.c at line 343
[4.4134]→[4.4134:4185](∅→∅) − bhunk->filedel.path = bincode_getstr(bc, slen);
+ bhunk->filedel.path = xmalloc(slen + 1);
+ bincode_getstr(bc, bhunk->filedel.path, slen);
replacement in change.c at line 354
[4.4389]→[4.4389:4442](∅→∅) − bhunk->fileundel.path = bincode_getstr(bc, slen);
+ bhunk->fileundel.path = xmalloc(slen + 1);
+ bincode_getstr(bc, bhunk->fileundel.path, slen);
replacement in change.c at line 377
[4.4765]→[5.374:409](∅→∅),
[5.374]→[5.374:409](∅→∅),
[5.409]→[4.4766:4796](∅→∅) − bhunk->solvenameconflict.path =
− bincode_getstr(bc, slen);
+ bhunk->solvenameconflict.path = xmalloc(slen + 1);
+ bincode_getstr(bc, bhunk->solvenameconflict.path, slen);
replacement in change.c at line 383
[4.4888]→[5.589:626](∅→∅),
[5.589]→[5.589:626](∅→∅),
[5.626]→[4.4889:4919](∅→∅) − bhunk->unsolvenameconflict.path =
− bincode_getstr(bc, slen);
+ bhunk->unsolvenameconflict.path = xmalloc(slen + 1);
+ bincode_getstr(
+ bc, bhunk->unsolvenameconflict.path, slen
+ );
replacement in change.c at line 455
[4.5414]→[4.5414:5466](∅→∅) − hashed->header.message = bincode_getstr(&bc, len);
+ hashed->header.message = xmalloc(len + 1);
+ bincode_getstr(&bc, hashed->header.message, len);
replacement in change.c at line 466
[4.5523]→[4.5523:5580](∅→∅) − hashed->header.description = bincode_getstr(&bc, len);
+ hashed->header.description = xmalloc(len + 1);
+ bincode_getstr(&bc, hashed->header.description, len);
replacement in change.c at line 475
[5.1248]→[4.5610:5664](∅→∅) − hashed->header.timestamp = bincode_getstr(&bc, len);
+ hashed->header.timestamp = xmalloc(len + 1);
+ bincode_getstr(&bc, hashed->header.timestamp, len);
replacement in change.c at line 495
[5.677]→[4.5779:5809](∅→∅) − bincode_getstr(&bc, len);
+ xmalloc(len + 1);
+ bincode_getstr(
+ &bc,
+ hashed->header.authors.map[i].entries[j].key,
+ len
+ );
replacement in change.c at line 503
[5.730]→[4.5840:5870](∅→∅) − bincode_getstr(&bc, len);
+ xmalloc(len + 1);
+ bincode_getstr(
+ &bc,
+ hashed->header.authors.map[i].entries[j].value,
+ len
+ );
replacement in change.c at line 747
− m->basename = bincode_getstr(&bc, len);
+ m->basename = xmalloc(len + 1);
+ bincode_getstr(&bc, m->basename, len);
replacement in bincode.h at line 37
[5.2269]→[5.2269:2498](∅→∅) − * Allocate and return a string of the given length.
− *
− * The memory allocated shall be the given length plus one, to hold the
− * terminating zero.
− *
− * Returns the allocated string. The caller is responsible for deallocating.
+ * Fill in a string of the given length, the destination should have
+ * sufficient space.
replacement in bincode.h at line 40
[5.2502]→[5.4766:4814](∅→∅) − char *bincode_getstr(struct bincode *, size_t);
+ void bincode_getstr(struct bincode *, char *, size_t);
edit in bincode.c at line 3
[5.2772]→[5.2772:2792](∅→∅) replacement in bincode.c at line 67
[5.3322]→[5.3322:3329](∅→∅),
[5.3329]→[5.5014:5060](∅→∅) − char *
− bincode_getstr(struct bincode *s, size_t len)
+ void
+ bincode_getstr(struct bincode *s, char *str, size_t len)
replacement in bincode.c at line 70
[5.3370]→[5.3370:3382](∅→∅),
[5.3382]→[5.1566:1579](∅→∅),
[5.1579]→[5.3382:3383](∅→∅),
[5.3382]→[5.3382:3383](∅→∅),
[5.3383]→[5.1580:1593](∅→∅),
[5.1593]→[5.3383:3408](∅→∅),
[5.3383]→[5.3383:3408](∅→∅),
[5.3408]→[5.1594:1616](∅→∅),
[5.959]→[5.3430:3448](∅→∅),
[5.1616]→[5.3430:3448](∅→∅),
[5.3430]→[5.3430:3448](∅→∅),
[5.3448]→[2.119:120](∅→∅) − char *str;
− uint8_t *b;
−
− b = s->buf;
− str = xmalloc(len + 1);
− memcpy(str, b, len);
− str[len] = '\0';
−
+ memcpy(str, s->buf, len);
replacement in bincode.c at line 73
[5.3449]→[5.3449:3462](∅→∅)