瀏覽代碼

slightly cleaner fix

svn:r4599
Roger Dingledine 20 年之前
父節點
當前提交
bb97d7f4ea
共有 1 個文件被更改,包括 2 次插入3 次删除
  1. 2 3
      src/common/container.c

+ 2 - 3
src/common/container.c

@@ -370,13 +370,12 @@ char *smartlist_join_strings2(smartlist_t *sl, const char *join,
   for (i = 0; i < sl->num_used; ) {
     for (src = sl->list[i]; *src; )
       *dst++ = *src++;
-    if (++i < sl->num_used || terminate) {
+    if (++i < sl->num_used) {
       memcpy(dst, join, join_len);
       dst += join_len;
     }
   }
-  if (sl->num_used == 0 && terminate) {
-    /* another special case for length == 0 */
+  if (terminate) {
     memcpy(dst, join, join_len);
     dst += join_len;
   }