Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't assume localtime() result is non-nil #280

Merged
merged 3 commits into from Nov 17, 2023
Merged

Conversation

gwynne
Copy link
Contributor

@gwynne gwynne commented Nov 16, 2023

Check for localtime(3) returning a nil result.

Motivation:

This avoids calling strftime(3) with a NULL pointer in the odd case that localtime(3) fails. It also has the useful, if incidental, side effect of fixing building swift-log on Arch Linux (see vapor/toolbox#430 for more info).

Modifications:

Added a guard which returns a generic failure string if localtime(3) returns nil.

Result:

There should be no visible impact on virtually any users, seeing as how this has not been previously encountered, and the use of swift-log on at least one unofficial (but apparently commonly used) platform will be fixed.

@tomerd
Copy link
Member

tomerd commented Nov 16, 2023

fixing CI in #281

@tomerd tomerd enabled auto-merge (squash) November 16, 2023 21:48
@tomerd
Copy link
Member

tomerd commented Nov 17, 2023

@swift-server-bot test this please

@tomerd tomerd disabled auto-merge November 17, 2023 00:13
@tomerd tomerd enabled auto-merge (squash) November 17, 2023 00:13
@tomerd tomerd merged commit f447991 into apple:main Nov 17, 2023
11 of 12 checks passed
@ktoso ktoso added this to the 1.5.4 milestone Jan 22, 2024
cgrindel-self-hosted-renovate bot added a commit to cgrindel/rules_swift_package_manager that referenced this pull request Jan 22, 2024
This PR contains the following updates:

| Package | Update | Change |
|---|---|---|
| [apple/swift-log](https://togithub.com/apple/swift-log) | patch |
`from: "1.5.3"` -> `from: "1.5.4"` |

---

### Release Notes

<details>
<summary>apple/swift-log (apple/swift-log)</summary>

### [`v1.5.4`](https://togithub.com/apple/swift-log/releases/tag/1.5.4)

[Compare
Source](https://togithub.com/apple/swift-log/compare/1.5.3...1.5.4)

##### What's Changed

##### Cleanups & minor compatibility improvements

- Don't assume localtime() result is non-nil by
[@&#8203;gwynne](https://togithub.com/gwynne) in
[apple/swift-log#280
- Changes to build with Musl. by
[@&#8203;al45tair](https://togithub.com/al45tair) in
[apple/swift-log#283

##### Non code changes

- Add CocoaLumberjack to list of logging backends by
[@&#8203;ffried](https://togithub.com/ffried) in
[apple/swift-log#276
- update CI script by [@&#8203;tomerd](https://togithub.com/tomerd) in
[apple/swift-log#281
- Update README.md by [@&#8203;0xTim](https://togithub.com/0xTim) in
[apple/swift-log#279

##### New Contributors

- [@&#8203;ffried](https://togithub.com/ffried) made their first
contribution in
[apple/swift-log#276
- [@&#8203;0xTim](https://togithub.com/0xTim) made their first
contribution in
[apple/swift-log#279
- [@&#8203;al45tair](https://togithub.com/al45tair) made their first
contribution in
[apple/swift-log#283

**Full Changelog**:
apple/swift-log@1.5.3...1.5.4

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined),
Automerge - At any time (no schedule defined).

🚦 **Automerge**: Enabled.

♻ **Rebasing**: Whenever PR is behind base branch, or you tick the
rebase/retry checkbox.

👻 **Immortal**: This PR will be recreated if closed unmerged. Get
[config help](https://togithub.com/renovatebot/renovate/discussions) if
that's undesired.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR has been generated by [Renovate
Bot](https://togithub.com/renovatebot/renovate).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNi4xMDAuMCIsInVwZGF0ZWRJblZlciI6IjM2LjEwMC4wIiwidGFyZ2V0QnJhbmNoIjoibWFpbiJ9-->

Co-authored-by: Self-hosted Renovate Bot <361546+cgrindel-self-hosted-renovate[bot]@users.noreply.github.enterprise.com>
@gwynne gwynne deleted the patch-1 branch January 23, 2024 01:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants