Created
January 17, 2009 14:32
-
-
Save iratqq/48352 to your computer and use it in GitHub Desktop.
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
static inline int parse_opt_q(const char *arg) | |
{ | |
char *max_buff = safe_strdup(arg); | |
char *fill_buff = strchr(max_buff, '/'); | |
char *p; | |
if (opt_aq_max_buff) { | |
free(opt_aq_max_buff); | |
opt_aq_max_buff = NULL; | |
} | |
if (opt_aq_fill_buff) { | |
free(opt_aq_fill_buff); | |
opt_aq_fill_buff = NULL; | |
} | |
if (fill_buff != max_buff) { | |
/* max/fill format */ | |
*fill_buff ='\0'; | |
opt_aq_max_buff = safe_strdup(max_buff); | |
opt_aq_fill_buff = safe_strdup(fill_buff + 1); | |
} else { | |
/* max format */ | |
opt_aq_fill_buff = safe_strdup(max_buff); | |
} | |
free(max_buff); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment