剛剛在某 repository 裡,看到一筆 commit,只有多加了一行 // 註解,卻確實地解了一個 bug。

這段程式大概長得這樣:

  // example last names:
  //  - 王
  //  - 許
+ // add extra line of comment to avoid bug
  last_name[length] = '\0'; // null terminate the string
  printf("last name: %s\n", last_name);

前面有個 + 號的,就是多加的那一行註解。大家有看懂問題在哪裡嘛?:-p