stbsp_sprintf: `count` argument should use `size_t` instead of `int`
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Idoneità per principianti
- 35/100
Direzione di ricerca
Start with the declarations of stbsp_snprintf and stbsp_vsnprintf in stb_sprintf.h, then follow the count parameter into the internal formatting code to find where it is compared or decremented as a signed int. Change the parameter type to size_t and fix any sign-comparison warnings it causes. Done means the prototypes match the C standard library and the header still compiles cleanly. The issue leaves open whether the return type should change too, so check with a maintainer before touching that.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Looks like stbsp_snprintf and stbsp_vsnprintf uses int (signed) for buf size, while according to the standard C APIs it should use size_t (unsigned) . This may impose limitations for writing very large strings, the function will probably break when writing with buffers of 2GB of bytes on x86_64. Though I am not sure if system's snprintf doesn't also break in that range, because snprintf still returns an int. Nevertheless it would be good to change just for the conciseness of having the same declaration as the C APIs.
- Lingua principale
- C
- Stelle
- 18
- Fork
- 5
- Merge medio
- 1m
- PR unite (30g)
- 3
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di nothings/stb_sprintf
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
nothings/stb_sprintf#10 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
nothings/stb_sprintf#8 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
nothings/stb_sprintf#5 ·
-
[SECURITY] stbsp_snprintf with count=0 writes null terminator before bufferForse già presa Una pull request collegata a questa issue è aperta o già unita. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
nothings/stb_sprintf#4 ·
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 68/100
nothings/stb_sprintf#20 ·
Tutte le issue di nothings/stb_sprintf
Issue simili
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 85/100
CachyOS/kernel-patches#197 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
kovidgoyal/kitty#10976 ·
I maintainer di solito rispondono entro 1 giorno
-
[BUG] cuDSS 1.0 rejects libcudss_mtlayer_cuopt.so (status = 3): missing cudssThreadingGetPropertyAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 1 giorno
-
bug no-disc-needed
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
Jstar269/nakagawa-recomp#3421 ·
I maintainer di solito rispondono entro 1 giorno