#71 Safer code

Отворени
отворен преди 10 месеца от nuclearkev · 1 коментара

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" Bloom коментира преди 5 месеца
Притежател

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"); } ```
Впишете се за да се присъедините към разговора.
Зареждане...
Отказ
Запис
Все още няма съдържание.