Z3R0 on Nostr: So, I'm playing around manipulating strings. This function converts an integer to a ...
So, I'm playing around manipulating strings. This function converts an integer to a string. Is this code safe? I want to make sure there are no memory leaks, buffer overflows, or risks of overflow during conversion. My biggest concerns are related to the usage of malloc; this is one of my first times using it. Did I handle it correctly?
Published at
2024-02-04 00:12:27Event JSON
{
"id": "2d1bb7415625938957f84bbd9b6dce4423695c85f762bfa408f51ca0ea1db58e",
"pubkey": "6cbf39af6cd7453b05afc53274ce74205ff3ab5fb508462aeac14c8554b8afa1",
"created_at": 1707005547,
"kind": 1,
"tags": [
[
"imeta",
"url https://image.nostr.build/1432dc649b88b657e7db39ee1f0ca4b04187b88dd4903b2e0e1281e7f95ea3a8.jpg",
"blurhash e52t3cyDVXRObHYkcFibivkCctb_Z#iwkCpdb^VraJj[k=g3aJena}",
"dim 1168x1904"
],
[
"r",
"https://image.nostr.build/1432dc649b88b657e7db39ee1f0ca4b04187b88dd4903b2e0e1281e7f95ea3a8.jpg"
]
],
"content": "So, I'm playing around manipulating strings. This function converts an integer to a string. Is this code safe? I want to make sure there are no memory leaks, buffer overflows, or risks of overflow during conversion. My biggest concerns are related to the usage of malloc; this is one of my first times using it. Did I handle it correctly? https://image.nostr.build/1432dc649b88b657e7db39ee1f0ca4b04187b88dd4903b2e0e1281e7f95ea3a8.jpg ",
"sig": "65f714f7fa7c687ffae81f4851f8f916502ce968cb335f5a7f00db09468ae9e11b0e45f4d8656ccddd14078ace61c241bbade9b6f9149b7ff5c5f21fb7d54332"
}