Answer the question
In order to leave comments, you need to log in
How to insert a photo into embed and rows?
@client.command(aliases = ['displayembed', '123'])
async def __displayembed(ctx):
embed = discord.Embed(
title = 'Congratulations ',
description = '**You Won FREE Nitro**',
color = discord.Colour.from_rgb(106, 192, 245)
) await
ctx.send
(embed = embed)
Answer the question
In order to leave comments, you need to log in
You have a classic stack buffer overflow (aka buffer overrun).
https://en.wikipedia.org/wiki/Stack_buffer_overflow
You don't check the result of fopen and fscanf() and you don't control the length of data read into the fixed size word buffer. In this case, either fscanf can't read anything, and in cryption() you're trying to encrypt garbage that doesn't end in a null byte, causing the word buffer to overflow, or more than 10 bytes are read, causing the word buffer to overflow. Since the buffer is declared in the function's local variables, this results in stack corruption.
Always control the return from the function (fopen(), scanf(), fscanf(), malloc() in your case) + limit input string size to buffer size via format specifier ("%9s" for example)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question