File tree Expand file tree Collapse file tree 1 file changed +11
-10
lines changed Expand file tree Collapse file tree 1 file changed +11
-10
lines changed Original file line number Diff line number Diff line change @@ -151,8 +151,7 @@ static void init_conn(int efd, struct econn *ec)
151
151
}
152
152
153
153
struct epoll_event evt = {
154
- .events = EPOLLOUT ,
155
- .data .ptr = ec ,
154
+ .events = EPOLLOUT , .data .ptr = ec ,
156
155
};
157
156
158
157
if (epoll_ctl (efd , EPOLL_CTL_ADD , ec -> fd , & evt )) {
@@ -429,14 +428,16 @@ int main(int argc, char *argv[])
429
428
* rq ++ = 0 ;
430
429
port = rq ;
431
430
rq = strchr (rq , '/' );
432
- if (* rq == '/' ) {
433
- port = strndup (port , rq - port );
434
- if (!port ) {
435
- perror ("port = strndup(rq, rq - port)" );
436
- exit (EXIT_FAILURE );
437
- }
438
- } else
439
- rq = "/" ;
431
+ if (rq ) {
432
+ if (* rq == '/' ) {
433
+ port = strndup (port , rq - port );
434
+ if (!port ) {
435
+ perror ("port = strndup(rq, rq - port)" );
436
+ exit (EXIT_FAILURE );
437
+ }
438
+ } else
439
+ rq = "/" ;
440
+ }
440
441
}
441
442
442
443
if (strnlen (udaddr , sizeof (ssun -> sun_path ) - 1 ) == 0 ) {
You can’t perform that action at this time.
0 commit comments