[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

[debian-hurd-Patches][312483] sound/hexter-0.6.1



Patches item #312483, was changed at 01/05/2010 16:18 by Samuel Thibault
You can respond by visiting: 
https://alioth.debian.org/tracker/?func=detail&atid=410472&aid=312483&group_id=30628

Status: Open
Priority: 3
Submitted By: Gokturk Yuksek (gokturk-guest)
Assigned to: Nobody (None)
Summary: sound/hexter-0.6.1 
Category: posix
Group: unreviewed
Resolution: None


Initial Comment:
Proposed patch solves PATH_MAX problem by calling 'snprintf' function with (NULL, 0, ...)  parameters to calculate how many characters to read (including the \0 character), and then calling it again with an allocated buffer to do actual operation.

Build log is also attached.

----------------------------------------------------------------------

>Comment By: Samuel Thibault (sthibault)
Date: 02/05/2010 12:29

Message:
+1 for the '/' and again +1 for the '\0'

It's simpler because glibc doesn't have to run snprintf twice.


----------------------------------------------------------------------

Comment By: Gokturk Yuksek (gokturk-guest)
Date: 02/05/2010 11:11

Message:
Why +1+1? If i'm not mistaken, strlen() returns the length of the string without the null character so strlen() + 1 should give the real length of the string and snprintf(..., "%s/") should exactly fit into the buffer.

I don't know why i couldn't see the simpler solution, thanks for the catch up though :)

----------------------------------------------------------------------

Comment By: Samuel Thibault (sthibault)
Date: 01/05/2010 16:41

Message:
Mmm, wouldn't it be simpler to allocate strlen(project_directory)+1+1?


----------------------------------------------------------------------

You can respond by visiting: 
https://alioth.debian.org/tracker/?func=detail&atid=410472&aid=312483&group_id=30628


Reply to: