Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon.

Pages: 1-

inet_ntoa

Name: Anonymous 2012-01-05 11:24

Does it leak memory or not?

Name: Anonymous 2012-01-05 11:29

I am unfamiliar with the function itself but here is what the manual page on my computer said it did.

The inet_ntoa() function converts the Internet host address in, given in network byte order, to  a  string  in  IPv4 dotted-decimal notation.  The string is returned in a statically allocated buffer, which subsequent calls will over‐write.

Name: F r o z e n V o i d !!mJCwdV5J0Xy2A21 2012-01-05 11:45

>2012
>Still using IPv4 only functions

Name: Anonymous 2012-01-05 11:47

>>3
Fuck off furfag.

Name: Anonymous 2012-01-05 11:50

>>1

No standard functions should leak memory. Stupid question.

Name: Anonymous 2012-01-05 12:09

>>>/jp/8357331

Name: Anonymous 2012-01-05 12:13

>>5
Does it leak memory or not?
No standard functions should leak memory.
How was it stupid?

Name: kodak_gallery_programmer !!kCq+A64Losi56ze 2012-01-05 12:32

>>5
By which standard? POSIX? Uhh... wait, never mind, I don't wanna know. Seriously. I'm afraid that your uneducated response might give me brain damage.

Name: Anonymous 2012-01-05 12:36

>>8
lolol is ur firm ded

Name: Anonymous 2012-01-05 12:44

>>9
Not quite yet you asshat.

Name: Anonymous 2012-01-05 13:36

Feck my rubs

Name: Anonymous 2012-01-05 13:45

Use inet_ntop for threads' sake

Name: Anonymous 2012-01-05 14:43

>>1
http://pubs.opengroup.org/onlinepubs/9699919799/functions/inet_addr.html
The return value of inet_ntoa() may point to static data that may be overwritten by subsequent calls to inet_ntoa().
So it depends on whether the function uses static data or allocates memory each time.

Name: Anonymous 2012-01-05 16:01

>>7
It was stupid in the sense that you didn't properly perceive the obvious fact that no one will design a function which intentionally leaks memory.

But it was not excessively stupid. Maybe it was just some lack of attention. Please don't get offended by it.

>>8
Yes. Tip: POSIX is a standard.

Don't worry about extending your brain damage. By your general presentation you seem to be already heavily afflicted.

Name: Anonymous 2012-01-07 6:45

>>10

good luck kodak-san. see it as an opportunity for something new. I'm sure you'll land on your feet somewhere, is on the tile flow of a bathroom, scrubbing toilets.

Name: Anonymous 2012-01-07 8:17

I think Kodak-san is cute, he's like an adorable mascot.

Name: Anonymous 2012-01-07 8:46

Perhaps he's asking whether it returns a pointer to dynamically allocated memory, in which case not deallocating it would lead to a memory leak.

The answer is no.

Name: Anonymous 2012-01-07 9:20

>>17
The answer is implementation dependent.

Name: Anonymous 2012-01-07 10:30

>>18
No, because the standard clearly says that it is allocated to a static buffer.

Name: Anonymous 2012-01-07 10:59

>>19
I'm not going to bother calling you any names since you probably just missed the answer in >>13, the standard says that it may be allocated in a static buffer, whether it really does so is up to the implementation.

The manual page excerpt in >>2 is the manual page of a specific implementation in which they decided to statically allocate the buffer.

Name: Anonymous 2012-01-07 12:32

>>20
My bad. Strange that they would leave it up to the implementation.  Makes portability a huge pain.

Name: DUBS LIBERATION FRONT 2012-03-24 18:31

NON-DUBS SHALL BE CLEANSED FROM THE EARTH!

Don't change these.
Name: Email:
Entire Thread Thread List