summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBladen Martin2020-05-28 22:24:18 +0530
committerGitHub2020-05-28 22:24:18 +0530
commit0c128ccda3fbb75522d317649917f695f0cf5ef1 (patch)
tree817b49b20afb31cbd2a23bea6d4c1c1e7f6d24bc
parentc8cfe4d383d38bdb9ebc5ed8b7f8cec60bdcb0e6 (diff)
downloadnghdl-0c128ccda3fbb75522d317649917f695f0cf5ef1.tar.gz
nghdl-0c128ccda3fbb75522d317649917f695f0cf5ef1.tar.bz2
nghdl-0c128ccda3fbb75522d317649917f695f0cf5ef1.zip
automate the writing of IP and port to the common_ip_file
-rw-r--r--src/model_generation.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/model_generation.py b/src/model_generation.py
index da8e272..dcb0788 100644
--- a/src/model_generation.py
+++ b/src/model_generation.py
@@ -268,7 +268,8 @@ class ModelGeneration:
if (fptr)
{
char line[20];
- while(fscanf(fptr, "%s", line) == 1) {
+ int line_port;
+ while(fscanf(fptr, "%s %d\\n", line, &line_port) == 2) {
ip_count++;
}
@@ -284,7 +285,7 @@ class ModelGeneration:
fptr = fopen(ip_filename, "a");
if (fptr)
{
- fprintf(fptr, "%s\\n", my_ip);
+ fprintf(fptr, "%s %d\\n", my_ip, sock_port);
fclose(fptr);
} else {
perror("Client - cannot open Common_IP file ");