#71 Safer code

オープン
10 ヶ月 前nuclearkev によって開かれました · 1 コメント
Kevin "The Nuclear" Bloom10 ヶ月 前 にコメントしました

After look at some of mg(1)'s code for reference, I discovered that there is a lot of code that I've written (and the previous 2 authors) that is kind of unsafe. Granted there are some things that don't really matter such as using sprintf(3) instead of asprintf(3) in the modeline but it would be nice to make sure that the memory is handle correctly.

I don't have this in a milestone because I don't know when I would do this.

After look at some of mg(1)'s code for reference, I discovered that there is a lot of code that I've written (and the previous 2 authors) that is kind of unsafe. Granted there are _some_ things that don't really matter such as using `sprintf(3)` instead of `asprintf(3)` in the modeline but it would be nice to make sure that the memory is handle correctly. I don't have this in a milestone because I don't know when I would do this.
Kevin "The Nuclear" Bloom5 ヶ月 前 にコメントしました
オーナー

While I've began part of this, it won't be completed for a long time. There are many uses of asprintf, str[n]dup, memcpy, and memccpy that aren't properly error checked. I'd like to make sure that any error like that is handle correctly, just in case. Something like what is below:

if((buf = strdup(str)) == NULL) {
  fatal("%s, out of memory");
}
While I've began part of this, it won't be completed for a long time. There are many uses of `asprintf`, `str[n]dup`, `memcpy`, and `memccpy` that aren't properly error checked. I'd like to make sure that any error like that is handle correctly, just in case. Something like what is below: ``` if((buf = strdup(str)) == NULL) { fatal("%s, out of memory"); } ```
会話に参加するには サインイン してください。
読み込み中…
キャンセル
保存
まだコンテンツがありません