FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
serpapi-cpp/src/callback.cpp at fix/cpp-error-handling · serpapi/serpapi-cpp · GitHub
Uh oh!
There was an error while loading.
Please reload this page
.
serpapi
/
serpapi-cpp
Public
Notifications
You must be signed in to change notification settings
Fork
0
Star
3
Code
Issues
0
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
serpapi-cpp
/
src
/
callback.cpp
Copy path
More file actions
More file actions
Latest commit
History
History
History
19 lines (17 loc) · 470 Bytes
Breadcrumbs
serpapi-cpp
/
src
/
callback.cpp
Copy path
File metadata and controls
19 lines (17 loc) · 470 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#
include
<
cstdint
>
#
include
<
limits
>
#
include
<
string
>
namespace
serpapi
{
size_t
callback
(
const
char
* in,
size_t
size,
size_t
num, std::string* out) {
if
(!out || !in)
return
0
;
if
(size ==
0
|| num ==
0
)
return
0
;
if
(size > std::numeric_limits<
size_t
>::
max
() / num)
return
0
;
const
size_t
totalBytes = size * num;
try
{
out->
append
(in, totalBytes);
return
totalBytes;
}
catch
(
const
std::exception&) {
return
0
;
}
}
}
//
namespace serpapi
Back
|
FazBrowse Home
|
New Git URL