Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
Packetdrill_tarr_ext
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Stefan Gense
Packetdrill_tarr_ext
Commits
aa3dc884
Commit
aa3dc884
authored
6 years ago
by
Michael Tüxen
Browse files
Options
Downloads
Patches
Plain Diff
Avoid pointer arithmetic involving void pointers.
parent
7df1bfc3
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
gtests/net/packetdrill/wire_client.c
+1
-1
1 addition, 1 deletion
gtests/net/packetdrill/wire_client.c
gtests/net/packetdrill/wire_conn.c
+2
-2
2 additions, 2 deletions
gtests/net/packetdrill/wire_conn.c
with
3 additions
and
3 deletions
gtests/net/packetdrill/wire_client.c
+
1
−
1
View file @
aa3dc884
...
@@ -227,7 +227,7 @@ static void wire_client_receive_packets_done(struct wire_client *wire_client)
...
@@ -227,7 +227,7 @@ static void wire_client_receive_packets_done(struct wire_client *wire_client)
/* Die with the error message from the server, which
/* Die with the error message from the server, which
* is a C string following the fixed "done" message.
* is a C string following the fixed "done" message.
*/
*/
die
(
"%s"
,
(
char
*
)
(
buf
+
sizeof
(
done
))
)
;
die
(
"%s"
,
(
char
*
)
buf
+
sizeof
(
done
));
}
else
if
(
ntohl
(
done
.
num_events
)
!=
wire_client
->
num_events
)
{
}
else
if
(
ntohl
(
done
.
num_events
)
!=
wire_client
->
num_events
)
{
char
*
msg
=
NULL
;
char
*
msg
=
NULL
;
asprintf
(
&
msg
,
"bad wire server: bad message count: "
asprintf
(
&
msg
,
"bad wire server: bad message count: "
...
...
This diff is collapsed.
Click to expand it.
gtests/net/packetdrill/wire_conn.c
+
2
−
2
View file @
aa3dc884
...
@@ -179,7 +179,7 @@ static int write_bytes(struct wire_conn *conn,
...
@@ -179,7 +179,7 @@ static int write_bytes(struct wire_conn *conn,
}
}
assert
(
bytes_written
<=
buf_len
);
assert
(
bytes_written
<=
buf_len
);
buf_len
-=
bytes_written
;
buf_len
-=
bytes_written
;
buf
+
=
bytes_written
;
buf
=
(
char
*
)
buf
+
bytes_written
;
}
}
return
STATUS_OK
;
return
STATUS_OK
;
}
}
...
@@ -223,7 +223,7 @@ static int read_bytes(struct wire_conn *conn,
...
@@ -223,7 +223,7 @@ static int read_bytes(struct wire_conn *conn,
}
}
assert
(
bytes_read
<=
buf_len
);
assert
(
bytes_read
<=
buf_len
);
buf_len
-=
bytes_read
;
buf_len
-=
bytes_read
;
buf
+
=
bytes_read
;
buf
=
(
char
*
)
buf
+
bytes_read
;
}
}
return
STATUS_OK
;
return
STATUS_OK
;
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment