Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

All issues

Open
#2 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
c
Domain
cli

Research direction

Start by inspecting main, stringToBigNumber, BigNumberGetNumber, convertBase10ToN, convertCharToInt, and convertIntToChar, then reproduce conversions involving non-decimal bases and very large values. Done means source bases parse correctly, large-number conversions avoid overflow and leaks, integer arithmetic is reliable, and character handling is consistent for supported bases.

Written by the indexing model from the issue text.

Description

  1. Critical Logic Failure in Base Conversion
    The program is fundamentally broken. It does not correctly convert the input number from its source base to base 10. The code in main and the stringToBigNumber function incorrectly assume the input string is always a base-10 number, rendering the from argument useless. The program will only work if the source base is actually 10.

  2. Buggy stringToBigNumber Function
    The stringToBigNumber function fails to parse numbers from any base other than 10. It uses string[i] - '0' to convert characters to integers, which only works for the characters '0' through '9'. It completely ignores the convertCharToInt helper function, so it cannot handle digits like 'A' (for hexadecimal) or any other letter-based digit.

  3. Integer Overflow in BigNumberGetNumber
    The BigNumberGetNumber function converts a BigNumber back into a standard int. This defeats the entire purpose of the BigNumber library. If the number is too large to fit in an int, this function will overflow and return a meaningless value. This critical bug corrupts the result of the convertBase10ToN function, which relies on it.

  4. Significant Memory Leaks
    The convertBase10ToN function leaks memory inside its while loop. In each iteration, it allocates a new BigNumber for the result of the division (BigNumberDiv) and assigns it to the temp pointer, but it never frees the memory pointed to by the old temp. This leads to a memory leak that grows with the size of the input number.

  5. Inefficient and Inaccurate Use of pow()
    The BigNumberGetNumber function uses pow(), which is a floating-point math function, for integer arithmetic. This is highly inefficient and can introduce precision errors for large numbers, leading to incorrect calculations.

  6. Inconsistent Character Conversion
    The character-to-integer conversion functions are mismatched:

convertCharToInt supports bases up to 36 ('0'-'9', 'A'-'Z').

convertIntToChar supports bases up to 62 ('0'-'9', 'a'-'z', 'A'-'Z').

This means the program could generate output (e.g., in base 40) that it cannot correctly read back as input.

Dominant language
C
Stars
0
Forks
0
PR merge metrics
No merged PRs in 30d

Getting set up

We have not checked this project's setup files yet. Start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from BaseMax/BigNumberBaseConverterC

All issues in BaseMax/BigNumberBaseConverterC

Similar issues

More C issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.