forked from vanhauser-thc/thc-hydra
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
SunOS compile support: add -lrt to support nanosleep(); add definitio…
…n of strndup()
- Loading branch information
Aaron Lewis
committed
Dec 29, 2016
1 parent
796992d
commit 34f5d55
Showing
2 changed files
with
26 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -114,6 +114,27 @@ ptr_header_node header_exists(ptr_header_node * ptr_head, char *header_name, cha | |
return found_header; | ||
} | ||
|
||
#if defined(__sun) | ||
/* Written by Kaveh R. Ghazi <[email protected]> */ | ||
char * | ||
strndup (const char *s, size_t n) | ||
{ | ||
char *result; | ||
size_t len = strlen (s); | ||
|
||
if (n < len) | ||
len = n; | ||
|
||
result = (char *) malloc (len + 1); | ||
if (!result) | ||
return 0; | ||
|
||
memcpy (result, s, len); | ||
result[len] = '\0'; | ||
return(result); | ||
} | ||
#endif | ||
|
||
int append_cookie(char *name, char *value, ptr_cookie_node *last_cookie) | ||
{ | ||
ptr_cookie_node new_ptr = (ptr_cookie_node) malloc(sizeof(t_cookie_node)); | ||
|