Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Commit eabec1c

Browse files
cbrackenCommit Bot
authored and
Commit Bot
committed
Use Utils::StrDup in place of strdup
This avoids warnings about strdup being deprecated in favour of _strdup on Windows. TEST=manual build, observe no warnings are produced Bug: flutter/flutter#59199 Change-Id: Ide390f3a719b9598bea0fc9976be3fb337f4de37 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/242386 Reviewed-by: Alexander Aprelev <[email protected]> Reviewed-by: Ryan Macnak <[email protected]> Commit-Queue: Alexander Aprelev <[email protected]>
1 parent d8b0237 commit eabec1c

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

runtime/vm/log_test.cc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
#include "platform/globals.h"
66

77
#include "include/dart_tools_api.h"
8+
#include "platform/utils.h"
89
#include "vm/dart_api_impl.h"
910
#include "vm/dart_entry.h"
1011
#include "vm/debugger.h"
@@ -23,7 +24,7 @@ static void TestPrinter(const char* buffer) {
2324
free(const_cast<char*>(test_output_));
2425
test_output_ = NULL;
2526
}
26-
test_output_ = strdup(buffer);
27+
test_output_ = Utils::StrDup(buffer);
2728

2829
// Also print to stdout to see the overall result.
2930
OS::PrintErr("%s", test_output_);

runtime/vm/tags.cc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
#include "vm/tags.h"
66

7+
#include "platform/utils.h"
78
#include "vm/isolate.h"
89
#include "vm/json_stream.h"
910
#include "vm/native_entry.h"
@@ -159,7 +160,7 @@ void UserTags::AddStreamableTagName(const char* tag) {
159160
return;
160161
}
161162
}
162-
subscribed_tags_.Add(strdup(tag));
163+
subscribed_tags_.Add(Utils::StrDup(tag));
163164
}
164165

165166
void UserTags::RemoveStreamableTagName(const char* tag) {

0 commit comments

Comments
 (0)